struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Lindholm <glindh...@yahoo.com>
Subject Re: HowTo: transfer parameter between actions?
Date Tue, 05 Aug 2008 13:18:08 GMT

You can pass parameters on a redirectAction, I do it all the time


<result type="redirectAction">
   PrepareDictionary
   /admin
   ${dictionaryId}
</result>



holod wrote:
> 
> 1.I have action PrepareDictionaryAction
> it has field String dictionaryId and appropriate getter and setter.
> dictionaryid comes from previous jsp. (enter.jsp)
> action sends user to dictionary.jsp
> 
> 2.dictionary jsp has hidden field <s:hidden name="dictionaryId"/>. So I
> will not be lost.
> 3.then through form submit user goes to WorkWithDictionaryAction.
> This action reads hidden field dictionaryId.
> 
> I want on result="success" send user to PrepareDictionaryAction and I
> don't want to loose  dictionaryId
> 
> This is struts.xml for "WorkWithDictionary:
> <action name="WorkWithDictionary"
> class="ibs.parliament.action.admin.WorkWithDictionaryAction">
>      		<result name="success" type="redirect-action">
> 				PrepareDictionary
> 				/admin
> 			</result>
> 			<result name="input">/admin/dictionary.jsp</result>
> 		</action>
> 
> As you can  see on "success" user will go to PrepareDictionary. This
> action needs dictionaryId, but I is lost on WorkWithDictionary action,
> this parameter doesn't go forward.
> 
> I would'nt like to use session, I would like to use something else. Does
> struts2 has special interceptor or result type for such tasks?
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/HowTo%3A-transfer-parameter-between-actions--tp18828496p18830938.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message