struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: [URGEN] Validation in Action and using redirection to view result page :(
Date Wed, 12 Apr 2006 12:03:23 GMT
Hi bowlkhin,

the approach that I used is this:

I have a JSP tile which just contains the HTML for errors and messages 
display.

I put a scriptlet in this tile after the errors and messages tags.

The scriptlet removes the error or message from the session.

Hope that helps.

Adam

Pham Anh Tuan on 12/04/06 07:42, wrote:
> Hi all,
> 
> case:
> I use Tiles and Velocity for presentation layer
> 
> com.project.GeneratedKeyAction: will generated and register information of code or capcha
(or do something here - retrieve list of user type from DB, etc) to session scope.
>   <!-- go to Information & Registration page - this page include registration
information and registration form -->
>   <action path="/rw/gotoInfoPage"
>    type="com.project.GeneratedKeyAction" scope="request"
>    validate="false">
>    <forward name="success" path="aInfoPage"/>
>   </action>
> 
> after user fullfill registration form, he/she submits this form with action /rw/processRegForm.do
>   <!-- process registration -->
>   <action name="regFormBean" path="/rw/processRegForm"
>    type="com.project.ProcessRegistration" scope="request"
>    validate="false">
>    <forward name="success" path="/rw/gotoInfoPage.do" redirect="true" />
>    <forward name="failure" path="/rw/gotoInfoPage.do" redirect="true" />
>    <forward name="systemFailure" path="aLoi"/>
>   </action>
> 
> as you saw, whether or not this registration process is successfull, I want the use back
to the info page (/rw/gotoInfoPage.do), if there's any error messages /successful messages,
this will be showed in the info page.
> 
> I read Struts document, and it said that, when I use redirection in forward tag, it means
all values which I saved in request scope will be empty, but ... If I don't use redirection
in forward tag (to forward to the info page - "/rw/gotoInfoPage"), user will see url: /rw/processRegForm.do
after the registration process, and if user refresh this page which has the url: /rw/processRegForm.do,
errors will occur because there's no form bean or any data to process :( 
> 
> but...
> 
> I couldn't save all my error message or any  messages in session scope, because, where
could I remove that messages from session scope after process was successful :(
> 
> Again, plz help me to solve this problem!
> 
> thanks in advance :(
> 
> bowlkhin


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


Mime
View raw message