On Fri, 15 Jun 2001, Simon Liang wrote:

> Hi guys:
> 
> I consider myself fairly new to Strut. I have done a login flow that allows
> user to edit his/her profile.
>  
> The login workflow is simple using the Struts framework:
> Map the login screen form to a form bean, then the action bean login the
> user and forward to the useredit.jsp upon a successful login.
> 
> But once I forward to the useredit.jsp, i am out of the Struts framework.
> The useredit.jsp would need to display the current user info for editing.
> How best is to do this within the Struts framework? The idea I have is to
> retrieve the user profile object and save in the session(to be done within
> the login action class). Then in the useredit.jsp, i can get the object back
> to display. Is this the right way in Struts or am I violating the Struts
> framework?
> 

The Struts example application includes something very similar to this --
you might want to take a look.

When you select the "edit registration info" link, you're actually going
to an action (/editRegistration) which creates a form bean with all the
appropriate data, and then forwards to the /registration.jsp page.  This
pages uses the Struts form tags, so it displays the information from the
form bean that was previously created.

This design idiom will be very common as you get more used to Struts.

> Please advice!
> 
> Thanks for any help in advance.
> 
> Cy
> 

Craig

Reply via email to