You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Lee <to...@shaw.ca> on 2002/12/03 00:49:47 UTC

How do you select to call doPost or doGet method of servlet?

When using the Requestdispatcher, how do you select to call doPost or doGet method 
of servlet? How to specify which one to call?

Thanks.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How do you select to call doPost or doGet method of servlet?

Posted by m batsis <mb...@netsmart.gr>.

Bill Barker wrote:

>You don't.  The call is determined by method on the original request.
>
Yes, the client (a browser for example) is the one that decides what 
method of request to use. You respond to any of those types with the 
appropriate method (doGet etc). Note that you can implement one and call 
it from another while passing the request and response objects:

public void doGet(HttpServletRequest req, HttpServletResponse res)
        throws IOException, ServletException
{
        doPost(req, res);
}

hth,

Manos

>
>"Peter Lee" <to...@shaw.ca> wrote in message
>news:3DEB811B.8181.C9A6FA@localhost...
>  
>
>>When using the Requestdispatcher, how do you select to call doPost or
>>    
>>
>doGet method
>  
>
>>of servlet? How to specify which one to call?
>>
>>Thanks.
>>    
>>
>
>
>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: How do you select to call doPost or doGet method of servlet?

Posted by jon wingfield <jo...@mkodo.com>.
although you can, in theory, wrap the original request in a
javax.servlet.http.HttpServletRequestWrapper with getMethod() overridden to
return the required value.   (If you want to)

-----Original Message-----
From: news [mailto:news@main.gmane.org]On Behalf Of Bill Barker
Sent: 03 December 2002 07:55
To: tomcat-user@jakarta.apache.org
Subject: Re: How do you select to call doPost or doGet method of
servlet?


You don't.  The call is determined by method on the original request.

"Peter Lee" <to...@shaw.ca> wrote in message
news:3DEB811B.8181.C9A6FA@localhost...
> When using the Requestdispatcher, how do you select to call doPost or
doGet method
> of servlet? How to specify which one to call?
>
> Thanks.





--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How do you select to call doPost or doGet method of servlet?

Posted by Bill Barker <wb...@wilshire.com>.
You don't.  The call is determined by method on the original request.

"Peter Lee" <to...@shaw.ca> wrote in message
news:3DEB811B.8181.C9A6FA@localhost...
> When using the Requestdispatcher, how do you select to call doPost or
doGet method
> of servlet? How to specify which one to call?
>
> Thanks.





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>