Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing values through multiple pages  RSS feed

 
adeeb alexander
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Store the values in the session.
 
alsoumahi alBatal
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • 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
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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?
 
Palak Mathur
Ranch Hand
Posts: 342
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As everyone has already mentioned, session is the way to go!! :)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!