• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to save data from vanishing during page navigation?

 
Ranch Hand
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JSP(A),enter some data in the page A and navigate to another page B(JSP),here I enter some data and again navigate to page A. Now ,I want Page A to have the previously entered data and I take the from data from page B and put into page A

As per my understanding If navigate to page B then data in page A destroyed, as well if I come to page A from Page B then Data entered in page B also destroyed.

How I save my data from vanishing?.

Please suggest good idea .
 
Sheriff
Posts: 67746
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
Use the value attributes on the form elements to pre-populate the data.
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jacob deiter wrote:I have a JSP(A),enter some data in the page A and navigate to another page B(JSP),here I enter some data and again navigate to page A. Now ,I want Page A to have the previously entered data and I take the from data from page B and put into page A

As per my understanding If navigate to page B then data in page A destroyed, as well if I come to page A from Page B then Data entered in page B also destroyed.

How I save my data from vanishing?.

Please suggest good idea .


hi jacob,

Can you elaborate more on the word navigating....
do you mean a <jsp:forward..> or a simple hyperlink
 
jacob deiter
Ranch Hand
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I meant jsp forward.But I can't get the difference between both.When clicked on hyperlink then a new URL is sent to server???.I hope JSP forward also do the same!!!
 
meehul Chopra
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jacob deiter wrote:I meant jsp forward.But I can't get the difference between both.When clicked on hyperlink then a new URL is sent to server???.I hope JSP forward also do the same!!!


hi jacob,

<jsp:forward..> works in the same way as a RequestDispatcher does,,that is all the forwarding happens at the server side.
So in your example you can always make use of attributes to save data for that request.

A hyperlink always generates a Get request.
 
jacob deiter
Ranch Hand
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI

Thanks for your reply.


do you mean a <jsp:forward..> or a simple hyperlink



Could you please explain the difference because I knew What it is but cant differentiate very clearly
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Could you please explain the difference because I knew What it is but cant differentiate very clearly



A hyperlink, sends a new request to the web server, but with a jsp:forward, the request is internally forwarded by the container. All the request parameters, and attributes remain intact during this process and ,and the page to which the jsp:forward is pointing can use these values.

With a plain hyperlink, only the session attributes, and form data is accessible, to the host jsp/servlet
 
reply
    Bookmark Topic Watch Topic
  • New Topic