You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ajay Patil <ap...@vertex.co.in> on 2003/07/11 09:15:12 UTC

Populating form from request parameters in JSP

Hello,

I know this question has probably been asked several times. But,
possibly a Struts developer can explain because I am confused.

Generally, my action classes receive posted data, query the database, 
put the query result as request attribute and then forward to the 
next JSP.

However, I find that form properties in the next JSP dont get
auto-populated from the request parameters.  So, I define a new
action class (associated with the next form), and use it simply
for forwarding. And then I can see the form properties auto-populated.

So, why is this extra step (or extra action class) needed ?

Or am doing something wrong here ?

Please clarify,
Ajay


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


Re: Populating form from request parameters in JSP

Posted by Nagendra Kumar O V S <na...@ikigo.com>.
hi,
your two jsp pages have  different  action forms associated with them. so u
cant expect the second jsp page to autopupulate the previous request
parameters. u have to go thro' the struts thing(action class) which will
then autopopulate ur new action form and then the jsp page associated will
show the values..

if both ur jsp pages share a single action form(which is in session) then
the second jsp page will automatically show the values

hope its clear now

-- nagi

-------Original Message-------

From: Struts Users Mailing List
Date: Friday, July 11, 2003 12:33:32 PM
To: struts-user@jakarta.apache.org
Subject: Populating form from request parameters in JSP

Hello,

I know this question has probably been asked several times. But,
possibly a Struts developer can explain because I am confused.

Generally, my action classes receive posted data, query the database, 
put the query result as request attribute and then forward to the 
next JSP.

However, I find that form properties in the next JSP dont get
auto-populated from the request parameters. So, I define a new
action class (associated with the next form), and use it simply
for forwarding. And then I can see the form properties auto-populated.

So, why is this extra step (or extra action class) needed ?

Or am doing something wrong here ?

Please clarify,
Ajay


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


.