struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paweł Wielgus" <poulw...@gmail.com>
Subject Re: Redirect after Post and persist data
Date Tue, 09 Dec 2008 09:40:34 GMT
Hi Dirk,
there is no simple answear to session question.
There is nothing bad in keeping last search data in session, until for
example Your session objects will grow so much that they will kill
Your server.
Just keep in mind what are the drawbacks of this solution.

Best greetings,
Paweł Wielgus.

2008/12/9 Dirk Forchel <dirk.forchel@exedio.com>:
>
> Redirect after post is a common pattern to hand control overt to another
> resource. The most common reason for using a redirect is the need to change
> the URL shown in the browser and to prevent the user to re-submit the
> previous request by clicking the reload-button.
>
> example config in struts.xml:
>
> <action name="search" class="com.foo.SearchAction">
>   <result type="redirect-action">list</result>
>   <result name="input">jsp/search.jsp</result>
> </action>
>
> <action name="list" class="com.foo.ListAction">
>   <result>jsp/list.jsp</result>
> </action>
>
> This seems to be straightforward.
> To persist data (the search result list) a session attribute in the
> session-scoped map could be used. As I read in "Struts 2 in Action", this
> could have a couple of drawbacks. What could be the problem with using the
> session scope as a data storage? What could be a good alternative besides
> using request parameters.
>
> for example:
>
> <action name="search" class="com.foo.SearchAction">
>   <result type="redirect-action">
>      [param name="actionName"]list[/param]
>      [param name="param1"]searchList[/param]
>      [param name="param2"]${searchResult}[/pararm]
>   </result>
>   <result name="input">jsp/search.jsp</result>
> </action>
>
> Dirk
> --
> View this message in context: http://www.nabble.com/Redirect-after-Post-and-persist-data-tp20910311p20910311.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