You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeff Knox <jk...@lvcm.com> on 2003/05/31 02:30:55 UTC
Forms and JSPs
Has anybody ever seen JSP pages that work with forms using the POST
method and not the GET method? I am using Apache 1.3.22 and Tomcat
4.1.24.
Any ideas out there?
Thanks,
Jeff
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by Jeff Knox <jk...@lvcm.com>.
I will have to enable Tomcat on that port again to give it a try.
I am also getting the following error in the catalina.out file:
[Ajp13] bad read: -103
Jeff
On Friday, May 30, 2003, at 06:35 PM, Justin Ruthenbeck wrote:
>
> What happens if you just hit Tomcat directly instead of going through
> Apache on your production system?
>
> At 05:57 PM 5/30/2003, you wrote:
>> Hmm, I just realized something I didn't mention -- the pages in
>> question work in the development environment (Sun ONE Studio). The
>> development environment uses it's own instance of Tomcat to parse the
>> pages. When I push the files over to the production environment it
>> fails. This leads me to believe that it's a configuration issue, but
>> I don't have a clue as to what would cause a failure at this point.
>> Examples:
>>
>> http://www.gamesquick.com/nfl2003/login.jsp
>> http://www.gamesquick.com/nfl2003/login.jsp?username=bob
>>
>> Both of the above URLs work from within the IDE while the second one
>> fails in the production environment. And when it fails it says it
>> can't find the server! Where might I look to figure out what the
>> difference is?
>>
>> Both instances are running on the same physical box. The working
>> version runs in Tomcat under the IDE. The failing one runs in an
>> Apache/Tomcat setup using mod_jk to handle the JSP requests.
>>
>> Thanks again,
>>
>> Jeff
>>
>>
>> On Friday, May 30, 2003, at 05:43 PM, Jason Bainbridge wrote:
>>
>>> On Sat, 31 May 2003 08:30, Jeff Knox wrote:
>>>> Has anybody ever seen JSP pages that work with forms using the POST
>>>> method and not the GET method? I am using Apache 1.3.22 and Tomcat
>>>> 4.1.24.
>>>
>>> Yup I am using it in work's intranet application but with Apache
>>> 2.0.44 &
>>> Tomcat 4.1.24, I also use GET on a few forms without any problems. :)
>>>
>>> --
>>> Jason Bainbridge
>>> KDE Web Team - http://kde.org
>>> webmaster@kde.org
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> ____________________________________
> Justin Ruthenbeck
> Software Engineer, NextEngine Inc.
> justinr - AT - nextengine DOT com
> Confidential
> See http://www.nextengine.com/confidentiality.php
> ____________________________________
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by Justin Ruthenbeck <ju...@nextengine.com>.
What happens if you just hit Tomcat directly instead of going through
Apache on your production system?
At 05:57 PM 5/30/2003, you wrote:
>Hmm, I just realized something I didn't mention -- the pages in question
>work in the development environment (Sun ONE Studio). The development
>environment uses it's own instance of Tomcat to parse the pages. When I
>push the files over to the production environment it fails. This leads me
>to believe that it's a configuration issue, but I don't have a clue as to
>what would cause a failure at this point. Examples:
>
> http://www.gamesquick.com/nfl2003/login.jsp
> http://www.gamesquick.com/nfl2003/login.jsp?username=bob
>
>Both of the above URLs work from within the IDE while the second one fails
>in the production environment. And when it fails it says it can't find the
>server! Where might I look to figure out what the difference is?
>
>Both instances are running on the same physical box. The working version
>runs in Tomcat under the IDE. The failing one runs in an Apache/Tomcat
>setup using mod_jk to handle the JSP requests.
>
>Thanks again,
>
>Jeff
>
>
>On Friday, May 30, 2003, at 05:43 PM, Jason Bainbridge wrote:
>
>>On Sat, 31 May 2003 08:30, Jeff Knox wrote:
>>>Has anybody ever seen JSP pages that work with forms using the POST
>>>method and not the GET method? I am using Apache 1.3.22 and Tomcat
>>>4.1.24.
>>
>>Yup I am using it in work's intranet application but with Apache 2.0.44 &
>>Tomcat 4.1.24, I also use GET on a few forms without any problems. :)
>>
>>--
>>Jason Bainbridge
>>KDE Web Team - http://kde.org
>>webmaster@kde.org
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
____________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential
See http://www.nextengine.com/confidentiality.php
____________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by Jeff Knox <jk...@lvcm.com>.
It works!
Instead of recompiling Apache 1.3 to use threads I installed Apache 2.0
and mod_jk2. It took a bit of wrangling to get the configs working with
my virtual hosts, but now everything is happy and I can use parameters
on the URL.
Thanks everybody!
Jeff
On Saturday, May 31, 2003, at 01:04 PM, Jeff Knox wrote:
> AAAAAAAAAAAAAAAHHHHHHHHH! lol
>
> Ok, at first I was using the Warp connector and told to dump it
> because it wasn't supported and mod_jk was the way to go. Now you are
> telling me to go with mod_jk2?! I'll take a look at it. It's times
> like these when I know why I'm a programmer and not a sysadmin.
>
> Thanks for the info,
>
> Jeff
>
>
> On Saturday, May 31, 2003, at 12:54 PM, Jason Bainbridge wrote:
>
>> On Sun, 1 Jun 2003 03:35, Jeff Knox wrote:
>>> OK, I moved the server.xml file from the IDE to the production
>>> instance. Using port 8080 everything works great. I added a connector
>>> for mod_jk and sure enough it doesn't work. Would the problem be in
>>> the
>>> server.xml, httpd.conf or somewhere else? Here are the two
>>> connectors:
>>
>> I'm guessing your problem is more related to mod_jk itself and not
>> your
>> configuration, after a bit of googling it seems a few people had
>> similar
>> problems without any luck and given mod_jk isn't recommended any
>> longer you
>> might well be best to try mod_jk2, that is what I am using without any
>> problems.
>>
>> mod_jk2 does seem a bit fickle to setup though but I didn't have much
>> trouble
>> after reading a few howto's and the usual "I really should learn how
>> to type
>> one day" typo's one always seems to make in configuration files.
>>
>> Regards,
>> --
>> Jason Bainbridge
>> KDE Web Team - http://kde.org
>> webmaster@kde.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by Jeff Knox <jk...@lvcm.com>.
AAAAAAAAAAAAAAAHHHHHHHHH! lol
Ok, at first I was using the Warp connector and told to dump it because
it wasn't supported and mod_jk was the way to go. Now you are telling
me to go with mod_jk2?! I'll take a look at it. It's times like these
when I know why I'm a programmer and not a sysadmin.
Thanks for the info,
Jeff
On Saturday, May 31, 2003, at 12:54 PM, Jason Bainbridge wrote:
> On Sun, 1 Jun 2003 03:35, Jeff Knox wrote:
>> OK, I moved the server.xml file from the IDE to the production
>> instance. Using port 8080 everything works great. I added a connector
>> for mod_jk and sure enough it doesn't work. Would the problem be in
>> the
>> server.xml, httpd.conf or somewhere else? Here are the two connectors:
>
> I'm guessing your problem is more related to mod_jk itself and not your
> configuration, after a bit of googling it seems a few people had
> similar
> problems without any luck and given mod_jk isn't recommended any
> longer you
> might well be best to try mod_jk2, that is what I am using without any
> problems.
>
> mod_jk2 does seem a bit fickle to setup though but I didn't have much
> trouble
> after reading a few howto's and the usual "I really should learn how
> to type
> one day" typo's one always seems to make in configuration files.
>
> Regards,
> --
> Jason Bainbridge
> KDE Web Team - http://kde.org
> webmaster@kde.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: Forms and JSPs & Apache Thread Crash
Posted by Allen Williams <an...@csunv.com>.
Jason,
Could you post your config files? httpd.conf, worker2.conf, jk2.conf, and
server.xml (or, just point to where they are; I'll be glad to do the
download work). I've been through a few how- tos as well and had multiple
people here offer suggestions, with no success. Are you using WinNT?
TIA,
------------------------------
Allen
> -----Original Message-----
> From: Jason Bainbridge [mailto:jason@jblinux.org]
> Sent: Saturday, May 31, 2003 3:54 PM
> To: Tomcat Users List
> Subject: Re: Forms and JSPs
>
>
> On Sun, 1 Jun 2003 03:35, Jeff Knox wrote:
> > OK, I moved the server.xml file from the IDE to the production
> > instance. Using port 8080 everything works great. I added a connector
> > for mod_jk and sure enough it doesn't work. Would the problem be in the
> > server.xml, httpd.conf or somewhere else? Here are the two connectors:
>
> I'm guessing your problem is more related to mod_jk itself and not your
> configuration, after a bit of googling it seems a few people had similar
> problems without any luck and given mod_jk isn't recommended any
> longer you
> might well be best to try mod_jk2, that is what I am using without any
> problems.
>
> mod_jk2 does seem a bit fickle to setup though but I didn't have
> much trouble
> after reading a few howto's and the usual "I really should learn
> how to type
> one day" typo's one always seems to make in configuration files.
>
> Regards,
> --
> Jason Bainbridge
> KDE Web Team - http://kde.org
> webmaster@kde.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by Jason Bainbridge <ja...@jblinux.org>.
On Sun, 1 Jun 2003 03:35, Jeff Knox wrote:
> OK, I moved the server.xml file from the IDE to the production
> instance. Using port 8080 everything works great. I added a connector
> for mod_jk and sure enough it doesn't work. Would the problem be in the
> server.xml, httpd.conf or somewhere else? Here are the two connectors:
I'm guessing your problem is more related to mod_jk itself and not your
configuration, after a bit of googling it seems a few people had similar
problems without any luck and given mod_jk isn't recommended any longer you
might well be best to try mod_jk2, that is what I am using without any
problems.
mod_jk2 does seem a bit fickle to setup though but I didn't have much trouble
after reading a few howto's and the usual "I really should learn how to type
one day" typo's one always seems to make in configuration files.
Regards,
--
Jason Bainbridge
KDE Web Team - http://kde.org
webmaster@kde.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by Jeff Knox <jk...@lvcm.com>.
OK, I moved the server.xml file from the IDE to the production
instance. Using port 8080 everything works great. I added a connector
for mod_jk and sure enough it doesn't work. Would the problem be in the
server.xml, httpd.conf or somewhere else? Here are the two connectors:
<Connector
className="org.apache.catalina.connector.http.HttpConnector"
port="8080" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="60000"/>
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8009" minProcessors="5" maxProcessors="75"
enableLookups="true" redirectPort="8443"
acceptCount="10" debug="0" connectionTimeout="60000"/>
In httpd.conf I have:
<IfModule mod_jk.c>
JkWorkersFile "/usr/apache/tomcat/conf/jk/workers.properties"
JkLogFile "/usr/apache/tomcat/logs/mod_jk.log"
JkLogLevel error
</IfModule>
and in the virtual host I have:
JkMount /nfl2003/ ajp13
JkMount /nfl2003/* ajp13
I'm still getting the "[Ajp13] bad read: -103" error in catalina.out
and "[Sat May 31 12:28:26 2003] [notice] child pid 8349 exit signal
Segmentation Fault (11)" in the Apache error log.
<sigh>
Any ideas?
Thanks again,
Jeff
On Saturday, May 31, 2003, at 11:40 AM, Jeff Knox wrote:
> Steven,
>
> Thanks for the reply, this has me stumped. Sorry for the lack of
> information, but I just wasn't sure where to turn. I was hoping
> somebody could give me a starting point. I've been through the JSPs,
> server.xml and httpd.conf without luck. I compared the IDE's
> server.xml with the production server.xml and I can't find anything
> different. I'm more of a programmer than a sysadmin so I may be
> missing something incredibly simple.
>
>> One thought that comes to mind is, wtf are you *trying* to do
>> with the second URL?
>
> The page I used for a the sample URL is pretty basic and doesn't
> normally use the GET method. I just used it as an example because it
> is a fairly simple page and just passing a parameter to it on the URL
> shouldn't cause a failure. Passing parameters to any JSP pages causes
> the failure. The page is just a simple form that uses JSTL for some
> content processing. It currently doesn't call a bean directly.
>
> <%@page contentType="text/html"%>
> <%@taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
> <%@taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
> <html>
> <head><title>NFL 2003 Contest</title></head>
> <body bgcolor="#ffffff">
> <font face="Arial">
> <c:if test='${not empty param.username}'>
> <sql:query var='row'>
> SELECT * FROM contestants where user_name = ? and password = ?
> <sql:param value='${param.username}'/>
> <sql:param value='${param.password}'/>
> </sql:query>
> <c:choose>
> <c:when test='${row.rowCount == 0}'>
> The username and password you entered does not match our
> records.<br>
> Please reenter them or <a href="signup.jsp">create</a> a new
> account.
> </c:when>
> <c:otherwise>
> <c:set var='userName' value='${param.username}' scope='session'/>
> <c:redirect url='enterpicks.jsp'/>
> </c:otherwise>
> </c:choose>
> </c:if>
>
> <form method="post">
> <table border=1 cellpadding=5>
> <tr><td>
> <table border=0 width="100%">
> <tr><td colspan=2 align=center>Sign In<br><br></td></tr>
> <tr><td align="right">Username: </td><td><input type="text"
> name="username" maxlength=15 size=15 value="<c:out
> value='${param.username}'/>"></td></tr>
> <tr><td align="right">Password: </td><td><input type="password"
> name="password" maxlength=15 size=15><br><br></td></tr>
> <tr><td></td><td><input type="submit" value="Sign In"></td></tr>
> </table>
> </td></tr>
> <tr><td>If you don't have a login then you can <a
> href="signup.jsp">signup here</a>.</td></tr>
> </table>
> </form>
>
> </font>
>
> </body>
> </html>
>
>
> The only odd thing on the page is that <form method="post"> doesn't
> have an action attached, but the results are the same if I add an
> action statement to the tag.
>
>> I would also highly recommend using telnet to www.gamesquick.com
>> port 80 and simulating the two requests, to see exactly what error the
>> server is sending back to your browser.
>
> How do I send a request through telnet? I can telnet to port 80, but I
> don't know what it is waiting for. If I type in GET I get the index
> page from my default virtual host. If I try typing anything after the
> GET I get a 400 error.
>
>> Try installing a vanilla stand-alone tomcat, and test the second
>> version with that. If the problem goes away, then you know you need
>> to tweak your mod_jk mappings.
>
> I'll setup the stand alone again and see what happens. When you say
> "tweak your mod_jk mappings" what file are you referring to?
>
>> Further, it was back in 1996 that I last saw this behavior, and I
>> suspect that today servlets might be smarter about this.
>
> What's interesting is that I remember this same behavior from my last
> job. There we were using Oracle iAS which is based on Apache and
> Orion. I don't remember if they fixed the issue or we just coded
> around it. But it doesn't really matter since I don't work there any
> longer and it doesn't apply to this issue. ;^)
>
>> Ideally, the next step in troubleshooting this would be to look
>> at your logs and see exactly what requests mod_jk is forwarding, and
>> exactly what error tomcat is reporting when you request the second
>> URL.
>
> In looking at the mod_jk log I am getting this error:
>
> [Sat May 31 10:45:20 2003] [jk_uri_worker_map.c (595)]: In
> jk_uri_worker_map_t::map_uri_to_worker, wrong parameters
>
> I just tried google, but didn't find anything useful. I'll set the
> logging back to debug to see if it turns up any more information.
> Also, as I mentioned before catalina.out is logging "[Ajp13] bad read:
> -103". The Apache error log reports:
>
> [Sat May 31 11:32:31 2003] [notice] child pid 7807 exit signal
> Segmentation Fault (11)
>
> Next I'll try the stand alone again.
>
> Thanks,
>
> Jeff
>
>
>
>
> On Saturday, May 31, 2003, at 01:18 AM, Steven J. Owens wrote:
>
>> On Fri, May 30, 2003 at 05:57:25PM -0700, Jeff Knox wrote:
>>> Hmm, I just realized something I didn't mention -- the pages in
>>> question work in the development environment (Sun ONE Studio). The
>>> development environment uses it's own instance of Tomcat to parse the
>>> pages. When I push the files over to the production environment it
>>> fails. This leads me to believe that it's a configuration issue, but
>>> I
>>> don't have a clue as to what would cause a failure at this point.
>>> Examples:
>>>
>>> http://www.gamesquick.com/nfl2003/login.jsp
>>> http://www.gamesquick.com/nfl2003/login.jsp?username=bob
>>>
>>> Both of the above URLs work from within the IDE while the second one
>>> fails in the production environment. And when it fails it says it
>>> can't
>>> find the server! Where might I look to figure out what the difference
>>> is?
>>
>> Hm... lacking a *lot* of information here, it's impossible to say
>> what's happening. What exactly are you seeing?
>>
>> I tried to load both URLs, the second URL doesn't load. I tried
>> to troubleshoot this by telnetting to www.gamesquick.com, port 80, and
>> simulating an HTTP GET request to get the login page, but *that*
>> didn't work for either URL.
>>
>> One thought that comes to mind is, wtf are you *trying* to do
>> with the second URL?
>>
>> Unless the login.jsp is coded to grab the username parameter from
>> the GET request and use it to pre-populate the login form, the second
>> URL should, at best, just produce the blank login form. Maybe you
>> should post your JSP source.
>>
>>> Both instances are running on the same physical box. The working
>>> version runs in Tomcat under the IDE. The failing one runs in an
>>> Apache/Tomcat setup using mod_jk to handle the JSP requests.
>>
>> This last detail (mod_jk) definitely points to a mapping issue.
>> Try installing a vanilla stand-alone tomcat, and test the second
>> version with that. If the problem goes away, then you know you need
>> to tweak your mod_jk mappings.
>>
>>>> On Sat, 31 May 2003 08:30, Jeff Knox wrote:
>>>>> Has anybody ever seen JSP pages that work with forms using the POST
>>>>> method and not the GET method?
>>
>> Just for the record, I have never seen this. It's conceivably
>> possible, depending much on the JSP compiler, but unlikely. If it
>> were going to happen, it would be like this:
>>
>> The JSP generates a servlet. Normally when you code your own
>> servlet, you define one or more of the HTTP request types (GET, POST,
>> HEAD, etc). A given request type has a specified method implemented
>> on the servlet (doPost(), doGet(), doHead(), etc). If you then
>> atttempt one of the unimplemented requests with that servlet, you
>> would get an error.
>>
>> So, conceivably your JSP might generate a servlet that only has
>> one of doGet() or doPost() implemented. However, I have no idea how
>> this is defined in the JSP spec, so I would not assume this is
>> happening.
>>
>> Further, it was back in 1996 that I last saw this behavior, and I
>> suspect that today servlets might be smarter about this. I *know* for
>> a fact that if you use a POST but you define the
>> ACTION="http://foo.com?bar=baz", the bar=baz parameter will carry
>> through. This sort of fact, though strictly speaking unrelated,
>> suggests that the JSP compiler might be equally smart about generating
>> both doPost() and doGet() methods.
>>
>>
>> Having said all of this, your question above, and the further
>> example URLS you post, do not agree. There's nothing in the examples
>> you posted, or the further description of the problem, that suggests
>> that you're actually seeing a JSP that works wtih a POST but not a
>> GET. It's just suggesting that your mapping or your JSP is
>> incorrectly
>> defined, so that the username parameter trips things up.
>>
>> Ideally, the next step in troubleshooting this would be to look
>> at your logs and see exactly what requests mod_jk is forwarding, and
>> exactly what error tomcat is reporting when you request the second
>> URL.
>>
>> I would also highly recommend using telnet to www.gamesquick.com
>> port 80 and simulating the two requests, to see exactly what error the
>> server is sending back to your browser. I tried a moment ago, but I'm
>> apparently too tired or too drunk to even get the first URL
>> successfully.
>>
>> Good luck.
>>
>> --
>> Steven J. Owens
>> puff@darksleep.com
>>
>> "I'm going to make broad, sweeping generalizations and strong,
>> declarative statements, because otherwise I'll be here all night and
>> this document will be four times longer and much less fun to read.
>> Take it all with a grain of salt." - Me at http://darksleep.com
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by Jeff Knox <jk...@lvcm.com>.
Steven,
Thanks for the reply, this has me stumped. Sorry for the lack of
information, but I just wasn't sure where to turn. I was hoping
somebody could give me a starting point. I've been through the JSPs,
server.xml and httpd.conf without luck. I compared the IDE's server.xml
with the production server.xml and I can't find anything different. I'm
more of a programmer than a sysadmin so I may be missing something
incredibly simple.
> One thought that comes to mind is, wtf are you *trying* to do
> with the second URL?
The page I used for a the sample URL is pretty basic and doesn't
normally use the GET method. I just used it as an example because it is
a fairly simple page and just passing a parameter to it on the URL
shouldn't cause a failure. Passing parameters to any JSP pages causes
the failure. The page is just a simple form that uses JSTL for some
content processing. It currently doesn't call a bean directly.
<%@page contentType="text/html"%>
<%@taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<html>
<head><title>NFL 2003 Contest</title></head>
<body bgcolor="#ffffff">
<font face="Arial">
<c:if test='${not empty param.username}'>
<sql:query var='row'>
SELECT * FROM contestants where user_name = ? and password = ?
<sql:param value='${param.username}'/>
<sql:param value='${param.password}'/>
</sql:query>
<c:choose>
<c:when test='${row.rowCount == 0}'>
The username and password you entered does not match our
records.<br>
Please reenter them or <a href="signup.jsp">create</a> a new
account.
</c:when>
<c:otherwise>
<c:set var='userName' value='${param.username}' scope='session'/>
<c:redirect url='enterpicks.jsp'/>
</c:otherwise>
</c:choose>
</c:if>
<form method="post">
<table border=1 cellpadding=5>
<tr><td>
<table border=0 width="100%">
<tr><td colspan=2 align=center>Sign In<br><br></td></tr>
<tr><td align="right">Username: </td><td><input type="text"
name="username" maxlength=15 size=15 value="<c:out
value='${param.username}'/>"></td></tr>
<tr><td align="right">Password: </td><td><input type="password"
name="password" maxlength=15 size=15><br><br></td></tr>
<tr><td></td><td><input type="submit" value="Sign In"></td></tr>
</table>
</td></tr>
<tr><td>If you don't have a login then you can <a
href="signup.jsp">signup here</a>.</td></tr>
</table>
</form>
</font>
</body>
</html>
The only odd thing on the page is that <form method="post"> doesn't
have an action attached, but the results are the same if I add an
action statement to the tag.
> I would also highly recommend using telnet to www.gamesquick.com
> port 80 and simulating the two requests, to see exactly what error the
> server is sending back to your browser.
How do I send a request through telnet? I can telnet to port 80, but I
don't know what it is waiting for. If I type in GET I get the index
page from my default virtual host. If I try typing anything after the
GET I get a 400 error.
> Try installing a vanilla stand-alone tomcat, and test the second
> version with that. If the problem goes away, then you know you need
> to tweak your mod_jk mappings.
I'll setup the stand alone again and see what happens. When you say
"tweak your mod_jk mappings" what file are you referring to?
> Further, it was back in 1996 that I last saw this behavior, and I
> suspect that today servlets might be smarter about this.
What's interesting is that I remember this same behavior from my last
job. There we were using Oracle iAS which is based on Apache and Orion.
I don't remember if they fixed the issue or we just coded around it.
But it doesn't really matter since I don't work there any longer and it
doesn't apply to this issue. ;^)
> Ideally, the next step in troubleshooting this would be to look
> at your logs and see exactly what requests mod_jk is forwarding, and
> exactly what error tomcat is reporting when you request the second
> URL.
In looking at the mod_jk log I am getting this error:
[Sat May 31 10:45:20 2003] [jk_uri_worker_map.c (595)]: In
jk_uri_worker_map_t::map_uri_to_worker, wrong parameters
I just tried google, but didn't find anything useful. I'll set the
logging back to debug to see if it turns up any more information. Also,
as I mentioned before catalina.out is logging "[Ajp13] bad read: -103".
The Apache error log reports:
[Sat May 31 11:32:31 2003] [notice] child pid 7807 exit signal
Segmentation Fault (11)
Next I'll try the stand alone again.
Thanks,
Jeff
On Saturday, May 31, 2003, at 01:18 AM, Steven J. Owens wrote:
> On Fri, May 30, 2003 at 05:57:25PM -0700, Jeff Knox wrote:
>> Hmm, I just realized something I didn't mention -- the pages in
>> question work in the development environment (Sun ONE Studio). The
>> development environment uses it's own instance of Tomcat to parse the
>> pages. When I push the files over to the production environment it
>> fails. This leads me to believe that it's a configuration issue, but I
>> don't have a clue as to what would cause a failure at this point.
>> Examples:
>>
>> http://www.gamesquick.com/nfl2003/login.jsp
>> http://www.gamesquick.com/nfl2003/login.jsp?username=bob
>>
>> Both of the above URLs work from within the IDE while the second one
>> fails in the production environment. And when it fails it says it
>> can't
>> find the server! Where might I look to figure out what the difference
>> is?
>
> Hm... lacking a *lot* of information here, it's impossible to say
> what's happening. What exactly are you seeing?
>
> I tried to load both URLs, the second URL doesn't load. I tried
> to troubleshoot this by telnetting to www.gamesquick.com, port 80, and
> simulating an HTTP GET request to get the login page, but *that*
> didn't work for either URL.
>
> One thought that comes to mind is, wtf are you *trying* to do
> with the second URL?
>
> Unless the login.jsp is coded to grab the username parameter from
> the GET request and use it to pre-populate the login form, the second
> URL should, at best, just produce the blank login form. Maybe you
> should post your JSP source.
>
>> Both instances are running on the same physical box. The working
>> version runs in Tomcat under the IDE. The failing one runs in an
>> Apache/Tomcat setup using mod_jk to handle the JSP requests.
>
> This last detail (mod_jk) definitely points to a mapping issue.
> Try installing a vanilla stand-alone tomcat, and test the second
> version with that. If the problem goes away, then you know you need
> to tweak your mod_jk mappings.
>
>>> On Sat, 31 May 2003 08:30, Jeff Knox wrote:
>>>> Has anybody ever seen JSP pages that work with forms using the POST
>>>> method and not the GET method?
>
> Just for the record, I have never seen this. It's conceivably
> possible, depending much on the JSP compiler, but unlikely. If it
> were going to happen, it would be like this:
>
> The JSP generates a servlet. Normally when you code your own
> servlet, you define one or more of the HTTP request types (GET, POST,
> HEAD, etc). A given request type has a specified method implemented
> on the servlet (doPost(), doGet(), doHead(), etc). If you then
> atttempt one of the unimplemented requests with that servlet, you
> would get an error.
>
> So, conceivably your JSP might generate a servlet that only has
> one of doGet() or doPost() implemented. However, I have no idea how
> this is defined in the JSP spec, so I would not assume this is
> happening.
>
> Further, it was back in 1996 that I last saw this behavior, and I
> suspect that today servlets might be smarter about this. I *know* for
> a fact that if you use a POST but you define the
> ACTION="http://foo.com?bar=baz", the bar=baz parameter will carry
> through. This sort of fact, though strictly speaking unrelated,
> suggests that the JSP compiler might be equally smart about generating
> both doPost() and doGet() methods.
>
>
> Having said all of this, your question above, and the further
> example URLS you post, do not agree. There's nothing in the examples
> you posted, or the further description of the problem, that suggests
> that you're actually seeing a JSP that works wtih a POST but not a
> GET. It's just suggesting that your mapping or your JSP is incorrectly
> defined, so that the username parameter trips things up.
>
> Ideally, the next step in troubleshooting this would be to look
> at your logs and see exactly what requests mod_jk is forwarding, and
> exactly what error tomcat is reporting when you request the second
> URL.
>
> I would also highly recommend using telnet to www.gamesquick.com
> port 80 and simulating the two requests, to see exactly what error the
> server is sending back to your browser. I tried a moment ago, but I'm
> apparently too tired or too drunk to even get the first URL
> successfully.
>
> Good luck.
>
> --
> Steven J. Owens
> puff@darksleep.com
>
> "I'm going to make broad, sweeping generalizations and strong,
> declarative statements, because otherwise I'll be here all night and
> this document will be four times longer and much less fun to read.
> Take it all with a grain of salt." - Me at http://darksleep.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by "Steven J. Owens" <pu...@darksleep.com>.
On Fri, May 30, 2003 at 05:57:25PM -0700, Jeff Knox wrote:
> Hmm, I just realized something I didn't mention -- the pages in
> question work in the development environment (Sun ONE Studio). The
> development environment uses it's own instance of Tomcat to parse the
> pages. When I push the files over to the production environment it
> fails. This leads me to believe that it's a configuration issue, but I
> don't have a clue as to what would cause a failure at this point.
> Examples:
>
> http://www.gamesquick.com/nfl2003/login.jsp
> http://www.gamesquick.com/nfl2003/login.jsp?username=bob
>
> Both of the above URLs work from within the IDE while the second one
> fails in the production environment. And when it fails it says it can't
> find the server! Where might I look to figure out what the difference
> is?
Hm... lacking a *lot* of information here, it's impossible to say
what's happening. What exactly are you seeing?
I tried to load both URLs, the second URL doesn't load. I tried
to troubleshoot this by telnetting to www.gamesquick.com, port 80, and
simulating an HTTP GET request to get the login page, but *that*
didn't work for either URL.
One thought that comes to mind is, wtf are you *trying* to do
with the second URL?
Unless the login.jsp is coded to grab the username parameter from
the GET request and use it to pre-populate the login form, the second
URL should, at best, just produce the blank login form. Maybe you
should post your JSP source.
> Both instances are running on the same physical box. The working
> version runs in Tomcat under the IDE. The failing one runs in an
> Apache/Tomcat setup using mod_jk to handle the JSP requests.
This last detail (mod_jk) definitely points to a mapping issue.
Try installing a vanilla stand-alone tomcat, and test the second
version with that. If the problem goes away, then you know you need
to tweak your mod_jk mappings.
> >On Sat, 31 May 2003 08:30, Jeff Knox wrote:
> >>Has anybody ever seen JSP pages that work with forms using the POST
> >>method and not the GET method?
Just for the record, I have never seen this. It's conceivably
possible, depending much on the JSP compiler, but unlikely. If it
were going to happen, it would be like this:
The JSP generates a servlet. Normally when you code your own
servlet, you define one or more of the HTTP request types (GET, POST,
HEAD, etc). A given request type has a specified method implemented
on the servlet (doPost(), doGet(), doHead(), etc). If you then
atttempt one of the unimplemented requests with that servlet, you
would get an error.
So, conceivably your JSP might generate a servlet that only has
one of doGet() or doPost() implemented. However, I have no idea how
this is defined in the JSP spec, so I would not assume this is
happening.
Further, it was back in 1996 that I last saw this behavior, and I
suspect that today servlets might be smarter about this. I *know* for
a fact that if you use a POST but you define the
ACTION="http://foo.com?bar=baz", the bar=baz parameter will carry
through. This sort of fact, though strictly speaking unrelated,
suggests that the JSP compiler might be equally smart about generating
both doPost() and doGet() methods.
Having said all of this, your question above, and the further
example URLS you post, do not agree. There's nothing in the examples
you posted, or the further description of the problem, that suggests
that you're actually seeing a JSP that works wtih a POST but not a
GET. It's just suggesting that your mapping or your JSP is incorrectly
defined, so that the username parameter trips things up.
Ideally, the next step in troubleshooting this would be to look
at your logs and see exactly what requests mod_jk is forwarding, and
exactly what error tomcat is reporting when you request the second
URL.
I would also highly recommend using telnet to www.gamesquick.com
port 80 and simulating the two requests, to see exactly what error the
server is sending back to your browser. I tried a moment ago, but I'm
apparently too tired or too drunk to even get the first URL
successfully.
Good luck.
--
Steven J. Owens
puff@darksleep.com
"I'm going to make broad, sweeping generalizations and strong,
declarative statements, because otherwise I'll be here all night and
this document will be four times longer and much less fun to read.
Take it all with a grain of salt." - Me at http://darksleep.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by Jeff Knox <jk...@lvcm.com>.
Hmm, I just realized something I didn't mention -- the pages in
question work in the development environment (Sun ONE Studio). The
development environment uses it's own instance of Tomcat to parse the
pages. When I push the files over to the production environment it
fails. This leads me to believe that it's a configuration issue, but I
don't have a clue as to what would cause a failure at this point.
Examples:
http://www.gamesquick.com/nfl2003/login.jsp
http://www.gamesquick.com/nfl2003/login.jsp?username=bob
Both of the above URLs work from within the IDE while the second one
fails in the production environment. And when it fails it says it can't
find the server! Where might I look to figure out what the difference
is?
Both instances are running on the same physical box. The working
version runs in Tomcat under the IDE. The failing one runs in an
Apache/Tomcat setup using mod_jk to handle the JSP requests.
Thanks again,
Jeff
On Friday, May 30, 2003, at 05:43 PM, Jason Bainbridge wrote:
> On Sat, 31 May 2003 08:30, Jeff Knox wrote:
>> Has anybody ever seen JSP pages that work with forms using the POST
>> method and not the GET method? I am using Apache 1.3.22 and Tomcat
>> 4.1.24.
>
> Yup I am using it in work's intranet application but with Apache
> 2.0.44 &
> Tomcat 4.1.24, I also use GET on a few forms without any problems. :)
>
> --
> Jason Bainbridge
> KDE Web Team - http://kde.org
> webmaster@kde.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by Simone Leigh <si...@webservepro.com>.
PLEASE TAKE ME OFF THIS LIST!!!!!!!!!!!!!!!!!!!
> From: Jason Bainbridge <ja...@jblinux.org>
> Organization: KDE Web Team
> Reply-To: "Tomcat Users List" <to...@jakarta.apache.org>
> Date: Sat, 31 May 2003 08:43:29 +0800
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Subject: Re: Forms and JSPs
>
> On Sat, 31 May 2003 08:30, Jeff Knox wrote:
>> Has anybody ever seen JSP pages that work with forms using the POST
>> method and not the GET method? I am using Apache 1.3.22 and Tomcat
>> 4.1.24.
>
> Yup I am using it in work's intranet application but with Apache 2.0.44 &
> Tomcat 4.1.24, I also use GET on a few forms without any problems. :)
>
> --
> Jason Bainbridge
> KDE Web Team - http://kde.org
> webmaster@kde.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: Forms and JSPs
Posted by Jason Bainbridge <ja...@jblinux.org>.
On Sat, 31 May 2003 08:30, Jeff Knox wrote:
> Has anybody ever seen JSP pages that work with forms using the POST
> method and not the GET method? I am using Apache 1.3.22 and Tomcat
> 4.1.24.
Yup I am using it in work's intranet application but with Apache 2.0.44 &
Tomcat 4.1.24, I also use GET on a few forms without any problems. :)
--
Jason Bainbridge
KDE Web Team - http://kde.org
webmaster@kde.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org