Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing hidden fields between 5 different pages

 
Mahesh Eshwarappa
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have 5 TABS in my web application which represents 5 Jsp's
Whenever a user clicks on a tab a new Jsp is o/p on to the screen. In each Jsp am calling a bean to get data from the database for presentation purpose.
The user can randomly click on any tab and enter some parameters in the text box and select an option from a drop down list.
Each Jsp has about 2 drop downlists and textareas where the user will enter some data.
Whenever the user goes back to different tab the page should remember what he is selected before.
For ex If he is selected option1 in a dropdownlist in page1 of Tab1 and goes to tab2 and comes back to tab1.
The page should remeber what selections he made.
I would like to get ideas on how to implement this from u all.
Regards
Mahesh
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what the session is for. Create one or more session beans to hold the information you want, and populate them in the appropriate JSPs. The values will stay there until the session ends, and may be retrieved when building any of the pages.
 
Mahesh Eshwarappa
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frank,
Say if user's selected some option and entered some infmn at the browser end.
Iam submitting a form which contains information about the user's selections.
At present am having some 10 hidden fields and am submitting them whenever the user clicks the tab.So the hidden fields are passed in all successive pages thru the request object.
How does session object scale with my method of passing hidden fields.
Regards
Mahesh

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By going to the use of HttpSession you can cut out the hidden field text. Just keep that data in the session. Session objects simply hold various named objects in a Hashtable - your tradeoff is the memory required for the session versus the reduced amount of text that must be transmitted. You can explicitly drop these objects when the user signs off or you can let the servlet engine dispose of them when the session times out. Default timeout is 30 minutes in the JRun and Tomcat servlet engines.
Bill

------------------
author of:
 
Mahesh Eshwarappa
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bill,
Iam using Weblogic Server as Application as well as Webserver and our webapplication is going to be accessed by 1000's of users in future. If the session objects of large size are created at the server for each user , What implication does it have on memory.
If this is a better trade off..
Does using cookies have any advantages over URLRewriting in terms of performance.
Regards
Mahesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic