File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

invoking an action from a JSP page

 
Gaurav Pawar
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a struts application. To invoke this app i type a url manually into the browser.

The URLs look like these
http://localhost:8080/MyAction.do?id=1&q=how are you?&indx=3 (enter data)
http://localhost:8080/MyAction.do?id=2&indx=3 (retieve data)

Till now to check if the application is running fine i used to directly type in the URL in the browser.

Now i wish to write a JSP page for the same.

The issue is--> i will be having a jsp page with textfields for 'q' and 'indx'
but if i click button1 the value for 'id' should be 1 and button2 should result in 'id=2'

Can someone please help me/suggest the exact approach to this? How do i generate these urls so that they are fired from the browser and then invoke the action?.....(jsp example?)

This will be my first complete struts application if i succeed

Thanks in advance.
Regards,
Gaurav.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like a little touch of JavaScript to format the URLs on the button clicks is all that you need.
 
Gaurav Pawar
Ranch Hand
Posts: 37
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you suggest any good references/examples??
 
vishwanath nadimpally
Ranch Hand
Posts: 116
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gkpawar Pawar:
Can you suggest any good references/examples??


Have both your buttons call a javascript function passing the id as param, like this
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic