RE: Tomcat and Redirects

2007-11-13 Thread Tony Fountain
Good point regarding the compatibility kit, that completely slipped my
mind :).

Thanks,
Tony

-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 09, 2007 2:05 PM
To: Tomcat Users List
Subject: RE: Tomcat and Redirects

> From: Tony Fountain [mailto:[EMAIL PROTECTED]
> Subject: RE: Tomcat and Redirects
> 
> Just to clarify, you can run Java programs compiled in 1.4, but the 
> JVM installed on the machine running the app should be 1.5 or greater.

That's not true either.  All you need to run Tomcat 5.5 on a 1.4 JVM is
the small compatibility kit available on the Tomcat download page.
Tomcat 5.5 works perfectly well on JRE 1.4.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This Email has been scanned for all viruses by PAETEC Email Scanning
Services, utilizing MessageLabs proprietary SkyScan infrastructure. For
more information on a proactive anti-virus service working around the
clock, around the globe, visit http://www.paetec.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat and Redirects

2007-11-12 Thread Dwebb
Hi Chris,

This is exactly the answer I was looking for.  Thank you for your help.

Cheers,

Danny


On Sun, 2007-11-11 at 10:51 -0500, Christopher Schultz wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Bill,
> 
> Bill Barker wrote:
> > Tomcat always sends a 302 redirect when response.sendRedirect(newURL); is 
> > called.  However, a lot of user-agents wrongly follow the redirect with a 
> > GET when the initial request was a POST.
> 
> Actually, this behavior is basically grandfathered-into the HTTP
> specification. See section 10.3.3 of the HTTP/1.1 spec:
> 
> "If the 302 status code is received in response to a request other than
> GET or HEAD, the user agent MUST NOT automatically redirect the request
> unless it can be confirmed by the user, since this might change the
> conditions under which the request was issued.
> 
>   Note: RFC 1945 and RFC 2068 specify that the client is not allowed
>   to change the method on the redirected request.  However, most
>   existing user agent implementations treat 302 as if it were a 303
>   response, performing a GET on the Location field-value regardless
>   of the original request method. The status codes 303 and 307 have
>   been added for servers that wish to make unambiguously clear which
>   kind of reaction is expected of the client.
> "
> 
> Since the servlet specification does not say which redirection code
> should be used with response.sendRedirect (though it is pretty much
> always implemented as a 302), you will have to use response.setHeader
> and response.sendError with the code you prefer. I'm pretty sure you
> want to use either 303 or 307 and not 302 due to its inconsistent
> implementation.
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> 
> iD8DBQFHNyTx9CaO5/Lv0PARAgb6AKCI3eiqPBM2IQ8+XfUwxH4yNGT85QCeIGF2
> G1vMEtBhAU+nJVClTOPU9JQ=
> =7PAC
> -END PGP SIGNATURE-
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat and Redirects

2007-11-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bill,

Bill Barker wrote:
> Tomcat always sends a 302 redirect when response.sendRedirect(newURL); is 
> called.  However, a lot of user-agents wrongly follow the redirect with a 
> GET when the initial request was a POST.

Actually, this behavior is basically grandfathered-into the HTTP
specification. See section 10.3.3 of the HTTP/1.1 spec:

"If the 302 status code is received in response to a request other than
GET or HEAD, the user agent MUST NOT automatically redirect the request
unless it can be confirmed by the user, since this might change the
conditions under which the request was issued.

  Note: RFC 1945 and RFC 2068 specify that the client is not allowed
  to change the method on the redirected request.  However, most
  existing user agent implementations treat 302 as if it were a 303
  response, performing a GET on the Location field-value regardless
  of the original request method. The status codes 303 and 307 have
  been added for servers that wish to make unambiguously clear which
  kind of reaction is expected of the client.
"

Since the servlet specification does not say which redirection code
should be used with response.sendRedirect (though it is pretty much
always implemented as a 302), you will have to use response.setHeader
and response.sendError with the code you prefer. I'm pretty sure you
want to use either 303 or 307 and not 302 due to its inconsistent
implementation.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHNyTx9CaO5/Lv0PARAgb6AKCI3eiqPBM2IQ8+XfUwxH4yNGT85QCeIGF2
G1vMEtBhAU+nJVClTOPU9JQ=
=7PAC
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat and Redirects

2007-11-09 Thread Bill Barker

"Dwebb" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi All,
>
> I have a question about how Tomcat handles redirects.  We have a vendor
> who wrote an application for us and they tell us that they always use
> the same method of issuing redirects in their code.
>
> What we have seen is on certain requests from a WAP handset the
> application will issue a redirect and Tomcat will issue it as an HTTP
> 302 redirect.  On other handsets for some reason these same redirects
> are issued as an HTTP 200 with an embedded link that the user has to
> click on to redirect.
>
> We believe this may be to the POST headers that the handset is sending
> but haven't managed to narrow it down to which.
>
> We would like all of these redirects to be done with the automatic 302
> redirect.
>

Tomcat always sends a 302 redirect when response.sendRedirect(newURL); is 
called.  However, a lot of user-agents wrongly follow the redirect with a 
GET when the initial request was a POST.  I'm guessing that your vendor has 
some special code that is attempting to work around this.

> Is there any way to force these redirects to be done with the HTTP 302?
>
> We are running Tomcat 5.5.11, Java 1.4.2_04-b05 on Linux 2.6.9-34.ELsmp
>
> Cheers,
>
> Danny
>
>
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> 




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat and Redirects

2007-11-09 Thread Caldarale, Charles R
> From: Tony Fountain [mailto:[EMAIL PROTECTED] 
> Subject: RE: Tomcat and Redirects
> 
> Just to clarify, you can run Java programs compiled in 1.4, 
> but the JVM installed on the machine running the app should
> be 1.5 or greater.

That's not true either.  All you need to run Tomcat 5.5 on a 1.4 JVM is
the small compatibility kit available on the Tomcat download page.
Tomcat 5.5 works perfectly well on JRE 1.4.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat and Redirects

2007-11-09 Thread Tony Fountain
Just to clarify, you can run Java programs compiled in 1.4, but the JVM
installed on the machine running the app should be 1.5 or greater.  I'm
doing that now with a commercial app we purchased (Apache Tomcat 5.5.23,
JVM 1.5.0_12-b04 but the application itself is compiled under Java 1.4
and runs just fine.

Thanks,
Tony Fountain
Manager, Database Administration
Benefit Concepts, Inc.
(419) 244-9936 x9010 (office)
(419) 249-7221 (fax)

-Original Message-
From: Michael [mailto:[EMAIL PROTECTED] 
Sent: Friday, November 09, 2007 1:45 PM
To: Tomcat Users List
Subject: Re: Tomcat and Redirects

Dwebb wrote:
> We are running Tomcat 5.5.11, Java 1.4.2_04-b05 on Linux 
> 2.6.9-34.ELsmp

Hi Danny,

you shouldn't run tomcat 5.5.x with JAva 1.4.
It's designed to work with Java 5 and up.

bye
-- 

 OOXML - Say NO To Microsoft Office broken standard
http://www.noooxml.org

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This Email has been scanned for all viruses by PAETEC Email Scanning
Services, utilizing MessageLabs proprietary SkyScan infrastructure. For
more information on a proactive anti-virus service working around the
clock, around the globe, visit http://www.paetec.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat and Redirects

2007-11-09 Thread Michael

Dwebb wrote:

We are running Tomcat 5.5.11, Java 1.4.2_04-b05 on Linux 2.6.9-34.ELsmp


Hi Danny,

you shouldn't run tomcat 5.5.x with JAva 1.4.
It's designed to work with Java 5 and up.

bye
--
 OOXML - Say NO To Microsoft Office broken standard
http://www.noooxml.org

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat and Redirects

2007-11-09 Thread Martin Gainty
the quick answer is to handle the response-code in web.xml e.g.


  302
  /axis2-web/Error/error302.jsp


M--
- Original Message - 
From: "Dwebb" <[EMAIL PROTECTED]>
To: 
Sent: Friday, November 09, 2007 11:35 AM
Subject: Tomcat and Redirects


> Hi All,
> 
> I have a question about how Tomcat handles redirects.  We have a vendor
> who wrote an application for us and they tell us that they always use
> the same method of issuing redirects in their code.  
> 
> What we have seen is on certain requests from a WAP handset the
> application will issue a redirect and Tomcat will issue it as an HTTP
> 302 redirect.  On other handsets for some reason these same redirects
> are issued as an HTTP 200 with an embedded link that the user has to
> click on to redirect.  
> 
> We believe this may be to the POST headers that the handset is sending
> but haven't managed to narrow it down to which.
> 
> We would like all of these redirects to be done with the automatic 302
> redirect.  
> 
> Is there any way to force these redirects to be done with the HTTP 302?
> 
> We are running Tomcat 5.5.11, Java 1.4.2_04-b05 on Linux 2.6.9-34.ELsmp
> 
> Cheers,
> 
> Danny
> 
> 
> -
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]