• 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

Writting controller.jsp

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic