• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Passing values through multiple pages

 
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.
I have a problem and I have almost browsed everything but still I did not understand nor I got a clear solution. Suppose I have 5 pages, and each page have text fields. All the details should be shown at final page. How can I achieve this. Till now i tried this. I got only half.

test.jsp


this will take to test1.jsp on submit

test1.jsp



till here ok. I get output whatever we enter in previous page and a text field to enter more data. on submit it goes to test2.jsp

test2.jsp


Now here i wont see the first value Only one value is coming which we gave :banghead:

test3.jsp




Now this is last jsp to diplay all the values from three pages. But i get only the last two pages value. Missing the first one. Is there any easy way to get. I have total 10 pages i want the values at last page.


Thanks and Regards
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Store the values in the session.
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have another opinion which is I set the values taken from the previous pages as hidden elements in the current pages , so for example , in the second page only I have one hidden element to have one
value from the first page , the third page it has two hidden elements to have two values for the second page .....

or you can use session object , containing array of values , in every page add value to the array session

hope it helps
 
Bear Bibeault
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

alsoumahi alBatal wrote:I have another opinion which is I set the values taken from the previous pages as hidden elements in the current pages


That's the way it needs to be done when there are no sessions available -- but why go through all that complexity and hassle when using a technology like servlets which provides a session?
 
Ranch Hand
Posts: 343
Mac OS X Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As everyone has already mentioned, session is the way to go!! :)
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic