Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add user input from 2-3 pages to a single page

Status
Not open for further replies.

kalpanaakhilesh

Programmer
Apr 25, 2004
6
US
Hi,

I am desigining a website. I need suggestion as I am new to JSP. I am taking user inputs in 2-3 pages and those all inputs are shown to the user at 4th page. I am not sure if using JSP and beans it will work.

Thanks in advance.
 
They will be fine for this kind of thing.
 
Hey,

I have created separate beans for every pages and calling all beans on one single page is this ok. But I am not getting all parameters. It retrieves only the previous page parameters. Can anybody help?

Thanks.
 
>>>> It retrieves only the previous page parameters.

If you mean that a certain page only requests the <input> tag parameters from the previous page via :

String whatever = request.getParameter("something");

... then this is normal ...

This is what session variables are for, to persist data across multiple pages ...

Perhaps you might like to read the tutorial on JSP basics :

 
You can also embed the data as hidden form fields that access the beans. They will automatically populate with no additional coding required. Then each step of the form as full access to all data on the request.getParameter() call.

Its an alternative too sessions and one that has sparked more then one huge debate. I had to design a recent application session'less for various reasons and the hidden field approach worked well, just be sure to validate your data before you use it in the final stage.
 
siberian :

Yeah, but these are still <input> tags - which I reckon is where this guy is getting confused ...
 
Sure, the way I handle it is to outline all the data thats moving and embed the input tags into every form in the process with the bean populating the data (well, I am using struts actually but the concept is sound). At that point its a transparent process.

So is the session though, just an alternative option.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top