You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Endle, Cory" <Co...@Xiotech.com> on 2001/12/04 20:28:59 UTC

HTTP method POST is not supported by this URL

Can anyone help me with this one? 

I am running a simple servlet that that has a form that does a "post".  When
the form is submitted, I get the error
message HTTP method POST is not supported by this URL

Do I need something in my web.xml file?  My web.xml file just defines the
servlet and does some simple servlet mapping.

Thanks!

Cory Endle
Seagate/XIOtech
E-mail: cory_endle@xiotech.com


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: HTTP method POST is not supported by this URL

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
Endle, Cory wrote:

> Can anyone help me with this one? 
> 
> I am running a simple servlet that that has a form that does a "post".  When
> the form is submitted, I get the error
> message HTTP method POST is not supported by this URL
> 
> Do I need something in my web.xml file?  My web.xml file just defines the
> servlet and does some simple servlet mapping.

Nope. Just define a servlet and the URL mapping to it, like this:

<servlet>
   <servlet-name>PartManager</servlet-name>
   <servlet-class>PartManagerServlet</servlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>PartManager</servlet-name>
   <url-pattern>/servlet/PartManager</url-pattern>
</servlet-mapping>

Nix.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: HTTP method POST is not supported by this URL

Posted by Bo Xu <bo...@cybershop.ca>.
----- Original Message -----
From: "Bo Xu" <bo...@cybershop.ca>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, December 04, 2001 6:41 PM
Subject: Re: HTTP method POST is not supported by this URL


> ----- Original Message -----
> From: "Jim Urban" <ji...@netsteps.net>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Tuesday, December 04, 2001 4:07 PM
> Subject: RE: HTTP method POST is not supported by this URL
>
>
> > > So, doPost calls itself in an endless loop, sending the servlet into
> > oblivion...
> > Or until a java.lang.StackOverflowError exception is thrown. :)
> >
> > Seriously, if a servlet gets a StackOverflowError does that impact
Tomcat?
> > That is, can Tomcat run out of stack space if a loop in a servlet gets
out
> > of control.
> >
> > Jim
> >[...]
>
>
>
> I am testing it :-)
> *  the following is my code:
>     public class Test0 extends HttpServlet {
>         public void service(HttpServletRequest req, HttpServletResponse
res)
>                                 throws ServletException, IOException {
>             res.setContentType("text/html");
>             PrintWriter out = res.getWriter();
>             m();
>            out.println("hahahahaha");
>            out.close(); out=null;
>       }
>        private void m(){
>            m();
>        }
> }
>
> *  the following is the result:
>     - when I first invoke Test0, I got the following output in my browser
>     - then I can invoke  MyServlet class(es)
>     - but if I invoke Test0 _again_,  the "DOS prompt" of TC4.0 closed by
> itself !! (I didn't
>       use "shutdown" commond to close it)
>
>  * output:
> A Servlet Exception Has Occurred
> Exception Report:
> javax.servlet.ServletException: Invoker service() exception
>  at org.apache.catalina.servlets.InvokerServlet.serveRequest(Unknown
Source)
>  at org.apache.catalina.servlets.InvokerServlet.doGet(Unknown Source)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown
> Source)
>  at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown
Source)
>  at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
>  at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
>  at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
>  at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
>  at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
>  at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
>  at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
>  at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
>  at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
>  at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
>  at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
>  at org.apache.catalina.valves.AccessLogValve.invoke(Unknown Source)
>  at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
>  at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
>  at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
>  at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
>  at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
>  at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
>  at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
>  at org.apache.catalina.connector.http.HttpProcessor.process(Unknown
Source)
>  at org.apache.catalina.connector.http.HttpProcessor.run(Unknown Source)
>  at java.lang.Thread.run(Thread.java:484)
>
> Root Cause:
> java.lang.StackOverflowError
>  at Test0.m(Test0.java:23)
>  at Test0.m(Test0.java:23)
>  at Test0.m(Test0.java:23)
>  at Test0.m(Test0.java:23)
>  at Test0.m(Test0.java:23)
>   ...
>  (many...)
>
>
>
> Bo
> Dec.04, 2001
>[...]


my another testing result:
if I throw a permanent  UnavailableException by myself from service(...),  I
got
the following "output" in my browser:

HTTP Status 503 - Servlet invoker is currently unavailable
The requested service (Servlet invoker is currently unavailable) is not
currently available.

and I can invoke it again(I still get the same "output"),  the "DOS prompt"
of TC4.0 doesn't
closed by itself.  But for the java.lang.StackOverflowError(please see above
email), the "DOS
prompt" of TC4.0 closed by itself.

testing code:
public void service(HttpServletRequest req, HttpServletResponse res)
                                throws ServletException, IOException {
    res.setContentType("text/html");
    PrintWriter out = res.getWriter();
    out.println("another testing");
    throw new UnavailableException("permanent msg");
  }
}


Bo
Dec.04, 2001



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: HTTP method POST is not supported by this URL

Posted by Jim Urban <ji...@netsteps.net>.
Thanks, for taking the time to investigate this.  It would be nice if
somehow Tomcat could be made to be immune to such application errors.

Jim

-----Original Message-----
From: Bo Xu [mailto:bo@cybershop.ca]
Sent: Tuesday, December 04, 2001 5:41 PM
To: Tomcat Users List
Subject: Re: HTTP method POST is not supported by this URL


----- Original Message -----
From: "Jim Urban" <ji...@netsteps.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, December 04, 2001 4:07 PM
Subject: RE: HTTP method POST is not supported by this URL


> > So, doPost calls itself in an endless loop, sending the servlet into
> oblivion...
> Or until a java.lang.StackOverflowError exception is thrown. :)
>
> Seriously, if a servlet gets a StackOverflowError does that impact Tomcat?
> That is, can Tomcat run out of stack space if a loop in a servlet gets out
> of control.
>
> Jim
>[...]



I am testing it :-)
*  the following is my code:
    public class Test0 extends HttpServlet {
        public void service(HttpServletRequest req, HttpServletResponse res)
                                throws ServletException, IOException {
            res.setContentType("text/html");
            PrintWriter out = res.getWriter();
            m();
           out.println("hahahahaha");
           out.close(); out=null;
      }
       private void m(){
           m();
       }
}

*  the following is the result:
    - when I first invoke Test0, I got the following output in my browser
    - then I can invoke  MyServlet class(es)
    - but if I invoke Test0 _again_,  the "DOS prompt" of TC4.0 closed by
itself !! (I didn't
      use "shutdown" commond to close it)

 * output:
A Servlet Exception Has Occurred
Exception Report:
javax.servlet.ServletException: Invoker service() exception
 at org.apache.catalina.servlets.InvokerServlet.serveRequest(Unknown Source)
 at org.apache.catalina.servlets.InvokerServlet.doGet(Unknown Source)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown
Source)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
 at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
 at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
 at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
 at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
 at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
 at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
 at org.apache.catalina.valves.AccessLogValve.invoke(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
 at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
 at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
 at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
 at org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
 at org.apache.catalina.connector.http.HttpProcessor.run(Unknown Source)
 at java.lang.Thread.run(Thread.java:484)

Root Cause:
java.lang.StackOverflowError
 at Test0.m(Test0.java:23)
 at Test0.m(Test0.java:23)
 at Test0.m(Test0.java:23)
 at Test0.m(Test0.java:23)
 at Test0.m(Test0.java:23)
  ...
 (many...)



Bo
Dec.04, 2001



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: HTTP method POST is not supported by this URL

Posted by Bo Xu <bo...@cybershop.ca>.
----- Original Message -----
From: "Jim Urban" <ji...@netsteps.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, December 04, 2001 4:07 PM
Subject: RE: HTTP method POST is not supported by this URL


> > So, doPost calls itself in an endless loop, sending the servlet into
> oblivion...
> Or until a java.lang.StackOverflowError exception is thrown. :)
>
> Seriously, if a servlet gets a StackOverflowError does that impact Tomcat?
> That is, can Tomcat run out of stack space if a loop in a servlet gets out
> of control.
>
> Jim
>[...]



I am testing it :-)
*  the following is my code:
    public class Test0 extends HttpServlet {
        public void service(HttpServletRequest req, HttpServletResponse res)
                                throws ServletException, IOException {
            res.setContentType("text/html");
            PrintWriter out = res.getWriter();
            m();
           out.println("hahahahaha");
           out.close(); out=null;
      }
       private void m(){
           m();
       }
}

*  the following is the result:
    - when I first invoke Test0, I got the following output in my browser
    - then I can invoke  MyServlet class(es)
    - but if I invoke Test0 _again_,  the "DOS prompt" of TC4.0 closed by
itself !! (I didn't
      use "shutdown" commond to close it)

 * output:
A Servlet Exception Has Occurred
Exception Report:
javax.servlet.ServletException: Invoker service() exception
 at org.apache.catalina.servlets.InvokerServlet.serveRequest(Unknown Source)
 at org.apache.catalina.servlets.InvokerServlet.doGet(Unknown Source)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown
Source)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
 at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
 at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
 at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
 at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
 at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
 at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
 at org.apache.catalina.valves.AccessLogValve.invoke(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
 at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
 at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invokeNext(Unknown Source)
 at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
 at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
 at org.apache.catalina.connector.http.HttpProcessor.process(Unknown Source)
 at org.apache.catalina.connector.http.HttpProcessor.run(Unknown Source)
 at java.lang.Thread.run(Thread.java:484)

Root Cause:
java.lang.StackOverflowError
 at Test0.m(Test0.java:23)
 at Test0.m(Test0.java:23)
 at Test0.m(Test0.java:23)
 at Test0.m(Test0.java:23)
 at Test0.m(Test0.java:23)
  ...
 (many...)



Bo
Dec.04, 2001



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: HTTP method POST is not supported by this URL

Posted by Jim Urban <ji...@netsteps.net>.
> So, doPost calls itself in an endless loop, sending the servlet into
oblivion...
Or until a java.lang.StackOverflowError exception is thrown. :)

Seriously, if a servlet gets a StackOverflowError does that impact Tomcat?
That is, can Tomcat run out of stack space if a loop in a servlet gets out
of control.

Jim

-----Original Message-----
From: Nikola Milutinovic [mailto:Nikola.Milutinovic@ev.co.yu]
Sent: Tuesday, December 04, 2001 2:21 PM
To: Tomcat Users List
Subject: Re: HTTP method POST is not supported by this URL


Chad Alan Prey wrote:

> Holy Smoke...I know this one...you need to have doGet call doPost like
this:
>
> public void doGet (HttpServletRequest req, HttpServletResponse res)
> 	throws ServletException
> 	{
> 	doPost(req, res);
> 	}
>
> 	public void doPost (HttpServletRequest req, HttpServletResponse res)
> 	throws ServletException
> 	{
> 	doPost(req, res);
> 	}
>
> pretty slick eh?

So, doPost calls itself in an endless loop, sending the servlet into
oblivion...

And doPost, doGet and others are "protected" not "public" methods.

Nix.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: HTTP method POST is not supported by this URL

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
> yeah I fat fingered that...take the doPost out of doPost and it works...This
> is taken form Core Servlets by Hall.

One question - why would you need a HttpServlet? The only time I needed it what when I nedded HttpResponse object, so I could send redirect. And I didn't override doPost(), now I remeber. I just had to override service(), since it was still abstract (which it should be).

One needs to override doPost only if one wishes to specifically handle POST requests, I think.

Nix.

RE: HTTP method POST is not supported by this URL

Posted by Chad Alan Prey <cp...@earthlink.net>.
yeah I fat fingered that...take the doPost out of doPost and it works...This
is taken form Core Servlets by Hall.

-----Original Message-----
From: Nikola Milutinovic [mailto:Nikola.Milutinovic@ev.co.yu]
Sent: Tuesday, December 04, 2001 12:21 PM
To: Tomcat Users List
Subject: Re: HTTP method POST is not supported by this URL


Chad Alan Prey wrote:

> Holy Smoke...I know this one...you need to have doGet call doPost like
this:
>
> public void doGet (HttpServletRequest req, HttpServletResponse res)
> 	throws ServletException
> 	{
> 	doPost(req, res);
> 	}
>
> 	public void doPost (HttpServletRequest req, HttpServletResponse res)
> 	throws ServletException
> 	{
> 	doPost(req, res);
> 	}
>
> pretty slick eh?

So, doPost calls itself in an endless loop, sending the servlet into
oblivion...

And doPost, doGet and others are "protected" not "public" methods.

Nix.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: HTTP method POST is not supported by this URL

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
Chad Alan Prey wrote:

> Holy Smoke...I know this one...you need to have doGet call doPost like this:
> 
> public void doGet (HttpServletRequest req, HttpServletResponse res)
> 	throws ServletException
> 	{
> 	doPost(req, res);
> 	}
> 
> 	public void doPost (HttpServletRequest req, HttpServletResponse res)
> 	throws ServletException
> 	{
> 	doPost(req, res);
> 	}
> 
> pretty slick eh?

So, doPost calls itself in an endless loop, sending the servlet into oblivion...

And doPost, doGet and others are "protected" not "public" methods.

Nix.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: HTTP method POST is not supported by this URL

Posted by Chad Alan Prey <cp...@earthlink.net>.
Holy Smoke...I know this one...you need to have doGet call doPost like this:

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

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

pretty slick eh?

-----Original Message-----
From: Endle, Cory [mailto:Cory_Endle@Xiotech.com]
Sent: Tuesday, December 04, 2001 11:29 AM
To: 'Tomcat Users List'
Subject: HTTP method POST is not supported by this URL


Can anyone help me with this one?

I am running a simple servlet that that has a form that does a "post".  When
the form is submitted, I get the error
message HTTP method POST is not supported by this URL

Do I need something in my web.xml file?  My web.xml file just defines the
servlet and does some simple servlet mapping.

Thanks!

Cory Endle
Seagate/XIOtech
E-mail: cory_endle@xiotech.com


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>