Actually this is similar to what I had originally tried doing. What actually happened 
was the RequestDispatcher did forward to the correct servlet based on the parameter, 
which is fine. But the problem was it immediately went back to the servlet that the 
form had submitted to to start with.

But anyway, it\'s fixed now with JavaScript. :-)

thanks,

Liz
[EMAIL PROTECTED]
http://www.gymell.com


\"A mailing list for discussion about Sun Microsystem\'s Java              Servlet API 
Technology.\" <[EMAIL PROTECTED]> wrote:
> Liz:

How about having a \"DecidingServlet\" in the action url of your JSP form. (Make sure 
the method is post). In DecidingServlet, do a getParameter(\"ButtonA\") and 
getParameter(ButtonB\") and use a RequestDispatcher in the following way:

if (req.getParameter(\"ButtonA\") != null){
    Code to forward to servlet A with ReqDispatcher;
}
else if (req.getParameter(\"ButtonB\") != null) {
   Code to forward to servlet B with ReqDispatcher;
}

//IMPORTANT: Do not add any code here in DecidingServlet! If you do, this part of the 
code wil in fact be executed after the forward..
Hope this helps!
Geeta

___________________________________________________________________________
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

Reply via email to