>>> Jiger Patel <[EMAIL PROTECTED]> 22-Aug-00 1:01:18 PM >>>
>>Why does this happen, even though the servlet API for
>>the RequestDispatcher.forward() clearly says in its
>>first line:

>When you are forwarding to another servlet Are you specifying
>any method?? The answer is NO. So the default Method GET
>is taken

This is wrong.

If servlet A recieves a POST request and forward()s it to servlet B
the method identifier remains in the request - so servlet B recieves a
POST request as well.

You can do this by forwarding from a simple POST to a servlet which
has the following method:

  public void service(HttpServletRequest,HttpServletResponse)
  {
     Writer out=response.getWriter():
     out.setContentType("text/html");

out.println("<html><body><h1>method="+request.getMethod()+"</h1></body></html>");
   }

The problem is as I stated previously: webserver servlets don't tend
to implement POST because it's not really right to do that.



Nic Ferrier

___________________________________________________________________________
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