Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using multiple submit buttons

 
Rakesh Keerthi
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i have multiple Submit buttons on myjsp and the correspond to different servlets. could any one advice me how to map them correctly to correct servlet and also to perform the javascript for each(if assigned). below is the code that i used.




Thanks,
Rakesh

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*move all scriptlet code to a java class.

Coming to your question:
there are two ways, what i can think of ,

1. call a javascript function by passing a value onclick,
then construct servlet path according to JS function parameter and submit.

2. without javascript, just call a servlet there you get the value of submit button,
now you forward to appropriate servlets.
 
Rakesh Keerthi
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Venkataswamy, if you don't mind could you please post a sample code for both the mentioned methods, just the redirecting path is enough, so that, i can get an idea about how to do it.

Thanks,
Rakesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic