You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jonathan Gordon <jg...@viant.com> on 2000/03/16 08:30:23 UTC

Problem with POST to default jsp page

I'm having a problem posting to the default page of my site, index.jsp (set with
DirectoryIndex in http.conf), when I don't explicitly reference the page.  I
receive the error:
"HTTP method POST is not supported by this URL"

All of the following do work:
http://mymachine/
http://mymachine/index.jsp?foo=bar
http://mymachine/?foo=bar

as well as posting "foo=bar" to:
http://mymachine/index.jsp

the problem occurs when I post "foo=bar" to:
http://mymachine/

Any ideas?

My machine specifics:
RH Linux 6.1
Apache 1.3.9
Tomcat 3.0
Sun JDK 1.2.2

Thanks,

-- Jonathan.

Jonathan Gordon
-- call me at 415.659.3239 --
-- read about viant: http://www.viant.com/press_home_headlines.html --

Re: Problem with POST to default jsp page

Posted by Jonathan Gordon <jg...@viant.com>.
Actually, looking at the generated .java file, it's using the _jspService
method.  But I added the code you recommended, and no luck.  This didn't
surprise me, b/c I _can_ successfully post to index.jsp, as long as i explicitly
reference it in the url.  It's only when I attempt to post to http://mymachine/
that i receive a problem.  

any thoughts?

jonathan.


Gal Shachor wrote:
> 
>  Jonathan,
> 
> The JSP file was transformed to a servlet with a "doGet" method. All the
> file content is "kind of" sitting in the "doGet". You need to define a
> method named doPost in order to be able to serve JSP with POST.
> 
> Add something like:
> 
> <%!
>  public void doPost(HttpServletRequest request,
>                    HttpServletResponse response)
>                    throws IOException, ServletException
> {
>    doGet(request, response);
> }
> %>
> to your page.
> 
> This should add JSP POST method handling to the servlet generated from
> your
> page.
> 
>         Gal Shachor
> 
> Jonathan Gordon wrote:
> >
> > I'm having a problem posting to the default page of my site, index.jsp (set with
> > DirectoryIndex in http.conf), when I don't explicitly reference the page.  I
> > receive the error:
> > "HTTP method POST is not supported by this URL"
> >
> > All of the following do work:
> > http://mymachine/
> > http://mymachine/index.jsp?foo=bar
> > http://mymachine/?foo=bar
> >
> > as well as posting "foo=bar" to:
> > http://mymachine/index.jsp
> >
> > the problem occurs when I post "foo=bar" to:
> > http://mymachine/
> >
> > Any ideas?
> >
> > My machine specifics:
> > RH Linux 6.1
> > Apache 1.3.9
> > Tomcat 3.0
> > Sun JDK 1.2.2
> >
> > Thanks,
> >
> > -- Jonathan.
> >
> > Jonathan Gordon
> > -- call me at 415.659.3239 --
> > -- read about viant: http://www.viant.com/press_home_headlines.html --
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


-- 

Jonathan Gordon
-- call me at 415.659.3239 --
-- read about viant: http://www.viant.com/press_home_headlines.html --

Re: Problem with POST to default jsp page

Posted by Gal Shachor <sh...@il.ibm.com>.
 Jonathan,

The JSP file was transformed to a servlet with a "doGet" method. All the
file content is "kind of" sitting in the "doGet". You need to define a 
method named doPost in order to be able to serve JSP with POST.

Add something like:

<%! 
 public void doPost(HttpServletRequest request,
                   HttpServletResponse response)
        	   throws IOException, ServletException
{
   doGet(request, response);
}
%>
to your page.

This should add JSP POST method handling to the servlet generated from
your  
page.

	Gal Shachor

Jonathan Gordon wrote:
> 
> I'm having a problem posting to the default page of my site, index.jsp (set with
> DirectoryIndex in http.conf), when I don't explicitly reference the page.  I
> receive the error:
> "HTTP method POST is not supported by this URL"
> 
> All of the following do work:
> http://mymachine/
> http://mymachine/index.jsp?foo=bar
> http://mymachine/?foo=bar
> 
> as well as posting "foo=bar" to:
> http://mymachine/index.jsp
> 
> the problem occurs when I post "foo=bar" to:
> http://mymachine/
> 
> Any ideas?
> 
> My machine specifics:
> RH Linux 6.1
> Apache 1.3.9
> Tomcat 3.0
> Sun JDK 1.2.2
> 
> Thanks,
> 
> -- Jonathan.
> 
> Jonathan Gordon
> -- call me at 415.659.3239 --
> -- read about viant: http://www.viant.com/press_home_headlines.html --
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

Re: Problem with POST (Re: Problem with POST to default jsp page)

Posted by "Alexey V. Meledin" <av...@webclub.ru>.
Hi,
    Ian!

Thursday, March 16, 2000, 1:02:03 PM,  Вы написали:

IF> "Jonathan Gordon" <jg...@viant.com> writes:

>> I'm having a problem posting to the default page of my site, index.jsp (set with

IF>  I've been lurking for a couple of days with a very similar question:

IF>  On my Solaris (2.8 Intel) box I can POST arguments to
IF>  http://localhost:8080/something

IF>  but I *can't* POST arguments to http://localhost/something


IF>  I'm guessing (without having been able to follow through the apache
IF>  code) that apache has eaten the POST arguments before passing the
IF>  request on to tomcat.

IF>  What worries me is that I'm getting reports that the same combo
IF>  apache 1.3.11/tomcat 3.0 works fine under NT.

IF>  Does this sound familiar to anyone?

Yes, I have this problem either.
Apache 1.3.12 + mod_jser.so build on FreeBSD 3.3.

This problem was described at http://locus.apache.org/jyve-faq/Turbine/screen/DisplayQuestionAnswer/action/SetAll/project_id/2/faq_id/12/topic_id/43/question_id/259
and has there one answer: "Use precompiled module for Unix (Linux)".
But my Apache fails whith core with it and linux_base port. :(

Alexey V. Meledin <av...@webclub.ru>
InterForge Developers Group,  St-Petersburg, Russia
---------------------------------------------------
> > > > > > "InterForge to Forge Ahead" < < < < < <



Problem with POST (Re: Problem with POST to default jsp page)

Posted by Ian Fitchet <ia...@tornadogroup.com>.
"Jonathan Gordon" <jg...@viant.com> writes:

> I'm having a problem posting to the default page of my site, index.jsp (set with

 I've been lurking for a couple of days with a very similar question:

 On my Solaris (2.8 Intel) box I can POST arguments to
 http://localhost:8080/something

 but I *can't* POST arguments to http://localhost/something


 I'm guessing (without having been able to follow through the apache
 code) that apache has eaten the POST arguments before passing the
 request on to tomcat.

 What worries me is that I'm getting reports that the same combo
 apache 1.3.11/tomcat 3.0 works fine under NT.

 Does this sound familiar to anyone?

Cheers,

        Ian