Meaningless Drivel is fun!*
The moose likes Spring and the fly likes redirect to the same jsp on form submit 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 » Frameworks » Spring
Bookmark "redirect to the same jsp on form submit" Watch "redirect to the same jsp on form submit" New topic
Author

redirect to the same jsp on form submit

krishna gkv
Greenhorn

Joined: Oct 09, 2012
Posts: 2

Hi,

I have a jsp, which displays a multiple choice question with radio buttons. There are two buttons 'Submit' and 'Next'.
When a user selects an answer and submits the form, I want to display user with result saying correct or incorrect answer on the same jsp
page retaining the selected answer. Also the submit button should now be disabled and next button should be enabled.
I am using spring MVC.

When I am returning the same jsp from controller, the question with multiple options are displayed but the selected data is lost. Also the submit buttton is not disabled.
Any help is appreciated.
Vishal Shaw
Ranch Hand

Joined: Aug 09, 2012
Posts: 179
Hi,

I feel that's not required at all. You can submit your data with ajax and implement the logic accordingly.

But if you are adamant in using the current approach (as described by you), you can pass some parameters with the call to the specific page request. Based on that variable data, you can implement your requirement using javascript/jQuery.

Vishal


Programming is about thinking, NOT coding
krishna gkv
Greenhorn

Joined: Oct 09, 2012
Posts: 2
Thanks Vishal,
I will try with Ajax call.
 
Consider Paul's rocket mass heater.
 
subject: redirect to the same jsp on form submit
 
Similar Threads
multiple forms in struts
multiple submit buttons
Form submit
Why doesn't exercise 8-1 from Murach's Java Servlets work for me on IE7?
Pagination Problem