aspose file tools*
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
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: 123

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?