You can use a Javascript function to determine the name of the servlet, and
call it from the onsubmit() action listener.
Something like:
function callServlet(servletname){
document.form.formname.action = "/servlet/" + servletname
}
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Milt
Epstein
Sent: Thursday, June 17, 1999 12:21 PM
To: [EMAIL PROTECTED]
Subject: Re: Calling difeerent servlets from one HTML
On Thu, 17 Jun 1999, Resource Allocation wrote:
> Hi All,
>
> I'm facing a problem in calling diferent servlets from a single
> HTML. As you know we specify the servlet's address and name in
> action parameter of form tag. But what do I do if I want to call
> different servlets depending on what button is pressed. Does anybody
> knows some thing about it. Please respond urgently.
One thing you might be able to do is have each button be in it's own
form. (If they share other form input fields, you won't be able to do
this.)
Another is to have each button set a certain parameter and have one
"dispatching" servlet receiving things on the server end and passing
it on to the appropriate servlet based on the value of that parameter.
You should be able to use RequestDispatcher for this (I don't know the
details).
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html