
Signature
Regards
Nick
news@nickhavardxyz.com
P.S. Remove xyz to reply
If you use http post, your servlet must ovveride the
doPost(HttpServletRequest req, HttpServletResponse resp) method, not
doGet(req,res).
You can also add this to your servlet to redirect request to the doGet
method :
public void doPost(HttpServletRequest req, HttpServletResponse resp) {
doGet(req,resp);
}
Symon
> Hi
>
[quoted text clipped - 15 lines]
>
> How can I overcome this error? Thanks for your help.
Nick Havard - 31 Jan 2005 23:03 GMT
Hi
Thanks for your quick response.
The servlet already has the doPost method which gets invoked as expected. To
return back to the original jsp (index.jsp)I use the following two lines of
code.
RequestDispatcher dispatcher = request.getRequestDispatcher("index.jsp");
dispatcher.forward(request, response);
I tried your suggestion of calling doGet from within doPost, but the call to
the index.jsp is still made with a POST, and the error still persists. I
guess the request/response objects are already setup to use POST.
How can I get the index.jsp to implement the doPost method, or get the
index.jsp to catch the POST request under service.

Signature
Regards
Nick
news@nickhavardxyz.com
P.S. Remove xyz to reply
> If you use http post, your servlet must ovveride the
> doPost(HttpServletRequest req, HttpServletResponse resp) method, not
[quoted text clipped - 28 lines]
>>
>> How can I overcome this error? Thanks for your help.
> Hi
>
[quoted text clipped - 9 lines]
> HTTP method POST is not supported by this URL
> =================
I've never seen or heard of something like this. A JSP should have no problem
handling a POST request. Can you post an SSCCE that demonstrates the problem?
(http://www.physci.org/codes/sscce.jsp)
Nick Havard - 01 Feb 2005 20:32 GMT
Hi Symon, Ryan
I've managed to solve the problem.
In the first jsp, there are multiple servlets some of which didn't have the
doPost method overridden. I've added it in so that doPost calls doGet and it
now works.
It seems very strange to me that a call to a servlet uses the same calling
mechanism (i.e. POST) to then call a jsp, which then uses the same mechanism
again to call all jsp's and servlets referred to within.
Thanks for your help.

Signature
Regards
Nick
news@nickhavardxyz.com
P.S. Remove xyz to reply
>> Hi
>>
[quoted text clipped - 13 lines]
> problem handling a POST request. Can you post an SSCCE that demonstrates
> the problem? (http://www.physci.org/codes/sscce.jsp)
Ryan Stewart - 02 Feb 2005 02:02 GMT
[...]
> It seems very strange to me that a call to a servlet uses the same calling
> mechanism (i.e. POST) to then call a jsp, which then uses the same mechanism
> again to call all jsp's and servlets referred to within.
[...]
It has nothing to do with how the servlets call each other and everything to do
with the characteristics of the request which is passed to them.