aspose file tools*
The moose likes Struts and the fly likes Calling jsp file based on user input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Calling jsp file based on user input" Watch "Calling jsp file based on user input" New topic
Author

Calling jsp file based on user input

Sneha Durvasula
Greenhorn

Joined: Sep 26, 2013
Posts: 10
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61218
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sneha Durvasula
Greenhorn

Joined: Sep 26, 2013
Posts: 10
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61218
    
  66

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.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8908
    
    8

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Sneha Durvasula
Greenhorn

Joined: Sep 26, 2013
Posts: 10
Thanks Joe..I have done with Jquery and it worked
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling jsp file based on user input