aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Buttons in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Buttons in JSP" Watch "Buttons in JSP" New topic
Author

Buttons in JSP

tejaswini vasist
Greenhorn

Joined: Apr 10, 2004
Posts: 17
I have 3 buttons in my JSP.The servlet should capture the request and depending upon which button is pressed it should call a different jsp.
How can it be done?
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50677

Which button does what and how is entirely a matter of how you format the HTML and Javascript on the page. As such, this has been moved to the HTML/Javascript forum.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
you set the action attribute with the onclick with a regular button, not a submit button.
onclick="document.formName.action="yourJsp.jsp;document.formName.submit()";
 
 
subject: Buttons in JSP
 
Threads others viewed
how to delete multiple browse
Which feature of Struts suits this problem better ?
How to configure different action servlets?
How to disable portions of a page
Cache Problem
IntelliJ Java IDE