wood burning stoves 2.0*
The moose likes JSP and the fly likes the old form values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "the old form values" Watch "the old form values" New topic

the old form values

prat narang

Joined: Oct 27, 2003
Posts: 10
hi group,
i have one jsp page with some input fields and a submit button.
i've different links to reach this page. and my requirement is that if i am reaching at this page first time then the field should be blank otherwise it should show the values which i've entered previously.
could anybody tell me the way to proceed....
thank you
Winston Smith
Ranch Hand

Joined: Jun 06, 2003
Posts: 136
You'll need to implement some sort of session tracking, to keep track of first-time visitors to the page, and repeat visitors. An easy way to do this is to use set a session variable (e.g. session.setAttribute()). If you're wanting your form values to persist throughout pages, you can use a JavaBean to store the values as the user navigates through the pages.

for (int i = today; i < endOfTime; i++) { code(); }
prat narang

Joined: Oct 27, 2003
Posts: 10
thank you Winston Smith, I've done the things in the same way as u said. and it's working fine.
thank you
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: the old form values
Similar Threads
Struts 2: Prepopulating fields in a popup window.
Change values in dropdown dynamically
local variables getting carried across the request
Passing variables from asp to jsp
Dependent/chain comboboxes on same jsp page