struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Moseley <>
Subject Re: modifying the mapping input path during validation
Date Tue, 17 Dec 2002 20:18:26 GMT
Erik Hatcher wrote:

> Yes, it should be.  Do you have the form name listed on that action? 
> Let's see your action mappings for the prepare and edit actions.

       <action path="/admin/role/EditFormPrepare"

       <action path="/admin/role/Edit"
         <forward name="cancel" path="/" redirect="true"/>
         <forward name="reset" path="/"/>
         <forward name="failure" path="/"/>
         <forward name="success" path="/"/>

> The form bean itself is null... hmmm???  strange - only if you've not 
> specified it on the action mapping is my guess.

aha! looking at this mapping clears up at least part of the mystery...

the input path is "/". HomeAction actually forwards to a 
jsp with a bunch of tiles in it. Edit.jsp is one of those tiles, and its 
controlling action is EditFormPrepareAction.

this means that when EditForm fails validation, i have this forward chain:

EditForm --> HomeAction ---> Home.jsp ---> (tiles controller mechanism 
invokes EditFormPrepareAction) ---> Edit.jsp.

all of these forwards execute in the context of the same 
RequestProcessor tho, right? so presumably the EditForm instance gets 
passed all the way down the forward chain through the tiles controller 
invocation mechanism to EditFormPrepareAction?

is this an instance of "evil action chaining"? if so, what actually is 
the evil?

> Oh, there are always around things!  :)  Putting things in request or 
> session scope work, depending on whether you are doing a redirect.  Or 
> the evil action chaining keeping things available for you in a later 
> action.  And I'm sure some other tricks too.

yeah, there's no "cleaner" way that i can think of. my team is 
especially wary of using the session scope for managing page flow, so 
rewriting the forward path in the action is the least offensive hack :)

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message