• Post Reply Bookmark Topic Watch Topic
  • New Topic

Writting controller.jsp  RSS feed

 
Dhananjay Inamdar
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one jsp page "ReportParent.jsp", which contains number of data fields,one submit button and following 3 radio buttons.
- Detail Report
- Summary Report
- Average Report
User will select any one radio button and will press the submit button.
I have to write one controller jsp page which will take the all input data from the "ReportParent.jsp" and depends upon the selected radio button forword all the data to the respective jsp page.
Does anybody will guide me for how to write this middle controller jsp page.
Thanks in advance!
 
Dhananjay Inamdar
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Guys,
I read there is some mechanisum present called "JSP:FORWARD ", so can I use this to solve my problem? If yes then please tell me how to use this to solve my problem.

Thanks in advance
 
John Mallavalli
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dhananjay,
You can do this in the clientside itself. You can call a javascript function when you click submit.
In that function you can check for the value of the selected radiobox and based on the value, you can set the action attribute of the form which gets submitted.
So the logic goes something like below:
If the user has selected "Detail Report" option then you can set the action attribute of the form to detailreport.jsp.
If the user has selected "Summary Report" option then you can set the action attribute of the form to summaryreport.jsp.
If the user has selected "Average Report" option then you can set the action attribute of the form to averagereport.jsp.
Hope this helps.
Cheers,
John
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!