Miguel,
I had this problem alot when I was developing a management system. For example, on my DeleteConfirmation pages, I wanted to show all the info for the entity I was erasing (for example, a User). So how I set that up was 2 actions in my struts-config:


<action
   input="whatever"
   name="userForm"
   type="com.example.DeleteUserForward">
   <forward name="continue" path="/deleteUser.jsp" />
</action>

<action
   input="/deleteUser.jsp"
   name="userForm"
   type="com.example.DeleteUserAction">
   <forward name="success" path="/listUsers.do" redirect="true" />
   <forward name="failure" path="/deleteUser.jsp" />
</action>


So the idea here is that your first action is a pretty plain action that looks like this:


execute()
{
   UserForm userForm = (UserForm)form;
   userForm.setXXX;
   ...
   userForm.setXXX;
   request.setAttribute("userForm", userForm);
   return mapping.findForward("continue");
}

and when you get the JSP page, your userForm has been populated with all the necessary info.

Hope this helped,
Riyad

Miguel Arroz wrote:

Hello!

I want to display a JSP when a user clicks on a link on a previous page. The JSP has a form that must be populated with data before being displayed for the first time. How can I populate the form before showing it?

Yours

Miguel Arroz

Fire, walk with me.

Miguel Arroz - [EMAIL PROTECTED] - http://www.guiamac.com


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to