You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Tom Viers <to...@pubpress.com> on 2005/05/04 17:33:17 UTC
LookupDispatchAction question
Hello,
I am using a LookupDispatchAction to consolidate CRUD actions for a
particular element in my application.
As far a I can tell, only one input can be specified for this lookup
action.
Is there a way to dynamically specify the input forward based on which
action method was dispatched?
I have tried calling setInput() on the mapping, but an
IllegalStateException is thrown "Configuration is frozen".
Thanks in advance for the help,
Tom
Tom Viers
PICA Programming Team
tomv@pubpress.com
ext 2148
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: LookupDispatchAction question
Posted by Joe Germuska <Jo...@Germuska.com>.
This is actually a question better suited for the user list (in fact,
a question similar came up last week!)
You've run into the real problem, which is that your code can't
change an existing ActionConfig -- these are shared, so you'd have
all kinds of synchronization issues in a multi-threaded servlet
environment.
You may be able to apply the wildcard mapping:
http://struts.apache.org/userGuide/building_controller.html#action_mapping_wildcards
The wildcard matching creates an instantaneous copy of the matched
ActionConfig and populates values by doing match replacements, which
would probably handle your case.
Hope that helps,
Joe
At 11:33 AM -0400 5/4/05, Tom Viers wrote:
>Hello,
>
>I am using a LookupDispatchAction to consolidate CRUD actions for a
>particular element in my application.
>As far a I can tell, only one input can be specified for this lookup
>action.
>
>Is there a way to dynamically specify the input forward based on which
>action method was dispatched?
>
>I have tried calling setInput() on the mapping, but an
>IllegalStateException is thrown "Configuration is frozen".
>
>Thanks in advance for the help,
>Tom
>
>
>
>
>
>Tom Viers
>PICA Programming Team
>tomv@pubpress.com
>ext 2148
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>For additional commands, e-mail: dev-help@struts.apache.org
--
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: LookupDispatchAction question
Posted by Michael Jouravlev <jm...@gmail.com>.
If it is acceptable for you to specify input property in the action,
then you can forgo this property altogether. You need it only for
automatic error display. When input property is set, and validate is
set to true, and your validation method returns errors, Struts queues
errors into request object and forwards to your input path, without
calling action class.
Instead, you can do validation from the action class, and then
depending on result or on something else, you can forward to a needed
location. You can specify a whole bunch of them, be they input or not,
in your <forward> element.
You can also build new ActionForward object dynamically. Struts does
not allow to change static ActionForward objects, as you already
found.
Michael.
On 5/4/05, Tom Viers <to...@pubpress.com> wrote:
> Hello,
>
> I am using a LookupDispatchAction to consolidate CRUD actions for a
> particular element in my application.
> As far a I can tell, only one input can be specified for this lookup
> action.
>
> Is there a way to dynamically specify the input forward based on which
> action method was dispatched?
>
> I have tried calling setInput() on the mapping, but an
> IllegalStateException is thrown "Configuration is frozen".
>
> Thanks in advance for the help,
> Tom
>
> Tom Viers
> PICA Programming Team
> tomv@pubpress.com
> ext 2148
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org
Re: LookupDispatchAction question
Posted by Dakota Jack <da...@gmail.com>.
I assume that you know that you can specify your ActionForward in your
Action's methods, e.g. return new ActionForward("myPage");? You can
also specify all sorts of forwards in the mapping for success,
failure, etc. Just do this instead for update, delete, etc. with the
CRUD formula. You would be better, in my opinion, to jettison the
bloat in LookupDispatchAction for one of the solutions at
www.michaelmcgrady.com, my doppleganger. ///;-)
Jack
On 5/4/05, Tom Viers <to...@pubpress.com> wrote:
> Hello,
>
> I am using a LookupDispatchAction to consolidate CRUD actions for a
> particular element in my application.
> As far a I can tell, only one input can be specified for this lookup
> action.
>
> Is there a way to dynamically specify the input forward based on which
> action method was dispatched?
>
> I have tried calling setInput() on the mapping, but an
> IllegalStateException is thrown "Configuration is frozen".
>
> Thanks in advance for the help,
> Tom
>
> Tom Viers
> PICA Programming Team
> tomv@pubpress.com
> ext 2148
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>
--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org