• 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

Calling jsp file based on user input

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a html page with a radiobuttonlist.Based on the user's input on that I need to provide various input options..I have created JSP pages for the various options and was trying to use javascript.I am able to pass the input checked to the js script but couldnt proceed furthur.I am using struts2 framework.Can someone suggest some way of doing it
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it were me, I'd be using jQuery's .load() method to use Ajax to fetch the appropriate fragment to load based upon selection.
 
Sneha Durvasula
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks..Can you give me an outline structure of the way you are talking about,I am a new programmer in this area and dont have much idea
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The jQuery documentation is here.

The basics are that, in the event handler for the user event that will trigger the change, you call the .load() method with the URL of the JSP for the fragment you wish to insert.

If you are unfamiliar with JavaScript, you have a long learning curve ahead of you.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jQuery is pure awesome.
An alternative is the Struts approach: it would be simple to have an action take the radio button input and forward to the appropriate JSP.
There are plenty of links to tutorials and documentation on our Struts FAQ page. If you are new to programming, your first step should be to familiarize yourself with the resources available and the basics of working with an API (be it Struts or jQuery or something else). You will save yourself a lot of grief in the long run if you build a strong foundation.
 
Sneha Durvasula
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Joe..I have done with Jquery and it worked
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic