This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Display Result on Same Page? 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 "Display Result on Same Page?" Watch "Display Result on Same Page?" New topic
Author

Display Result on Same Page?

Yogan Raj
Greenhorn

Joined: Dec 15, 2012
Posts: 3
When I hit the submit button, the result are display on a new page. how do I force it to stay on the same page, here's my code.

Kathleen Angeles
Ranch Hand

Joined: Aug 06, 2012
Posts: 122

You 'submit'ted the form to the server.

HTTP is a stateless protocol.

When you submitted the form, you killed current state already. When the server replies, it replaces the 'entire' page. The previous page has gone to hell already.

Good for you, and all of us, there is Ajax. To work with it with less pain, use frameworks like jquery.

With ajax, you can use javascript to talk to your server (send AND receive data). With the data returned, use CSS, HTML, javascript, and tools like jquery UI, to update the part of the page you need to update; without affecting any other parts of the page.
Yogan Raj
Greenhorn

Joined: Dec 15, 2012
Posts: 3
Kathleen Angeles wrote:You 'submit'ted the form to the server.

HTTP is a stateless protocol.

When you submitted the form, you killed current state already. When the server replies, it replaces the 'entire' page. The previous page has gone to hell already.

Good for you, and all of us, there is Ajax. To work with it with less pain, use frameworks like jquery.

With ajax, you can use javascript to talk to your server (send AND receive data). With the data returned, use CSS, HTML, javascript, and tools like jquery UI, to update the part of the page you need to update; without affecting any other parts of the page.


is there anyway you can fix it ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display Result on Same Page?
 
Similar Threads
I want to know where to put jsp code to make an dynamic html page.
how to use javascript to download the file automatically?
How to retrieve value from .js and show the values in jsp ?
please any one cleare my error
Doubts in jsp