DO NOT REPLY [Bug 32811] - sendRedirect does not commit

2005-01-04 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=32811.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32811





--- Additional Comments From [EMAIL PROTECTED]  2005-01-05 02:38 ---
(In reply to comment #6)
 No, the client may have received other bytes prior to the redirect, e.g. the 
 content length or other headers.   

The first line of a response is the status line.  So, a redirect (302 -
SC_FOUND) cannot be sent after any other byte.  If the client has received bytes
the response should be considered committed and subsiquent calls to sendRedirect
should throw an exception.  However, that is not even the issue here.  

The issue is that the sendRedirect does not commit the response (as the spec
defines in its description of isCommitted).  The sendRedirect does not send the
302 status line to the client prior to an exception.  When an exception occurs
the buffer is reset and a 500 is sent instead.  It seems that the client should
still receive a 302 (SC_FOUND).  It appears that this is how other servlet
containers have interpreted the specification.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 32811] - sendRedirect does not commit

2005-01-03 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=32811.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32811





--- Additional Comments From [EMAIL PROTECTED]  2005-01-03 16:53 ---
(In reply to comment #4)

The spec states: The isCommitted method returns a boolean value indicating
whether any response bytes have been returned to the client. (SRV 5.1)  Clearly
this is not the case with Tomcat.  If it were true, the client would receive the
redirect not the error. 

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 32811] - sendRedirect does not commit

2005-01-03 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=32811.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32811


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID




--- Additional Comments From [EMAIL PROTECTED]  2005-01-03 19:24 ---
No, the client may have received other bytes prior to the redirect, e.g. the 
content length or other headers.   This area is covered well in the 
Servlet/JSP TCKs, which Tomcat passes.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: DO NOT REPLY [Bug 32811] - sendRedirect does not commit

2004-12-29 Thread George Sexton
I'm too lazy to use bugzilla on this:

What in the standard makes anyone here think processing of the JSP/Servlet
terminates once a HttpServletResponse.sendRedirect() is encountered? 

This is a common fallacy of people moving from ASP.

YOU ALWAYS NEED A RETURN STATEMENT IMMEDIATELY FOLLOWING A
sendRedirect()!!

George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
  

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, December 23, 2004 9:52 AM
 To: tomcat-dev@jakarta.apache.org
 Subject: DO NOT REPLY [Bug 32811] - sendRedirect does not commit
 
 DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG.
 RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
 http://issues.apache.org/bugzilla/show_bug.cgi?id=32811.
 ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND.
 INSERTED IN THE BUG DATABASE.
 
 http://issues.apache.org/bugzilla/show_bug.cgi?id=32811
 
 
 
 
 
 --- Additional Comments From [EMAIL PROTECTED]  
 2004-12-23 17:51 ---
 I'm surprised that page compiles in Jetty.
 Doesn't it use the Jasper compiler as well?
 
 AFAIK, sendRedirect and throw statements always need to be 
 contained in a branch if there is any code after them.
 
 I would, however, expect this page to return a redirect instead of 
 a server error.  I tested with 5.0.30 and it compiled but 
 returned a server 500
 error.
 
 %
  
 
 if(request.getParameter(test) == null){
 response.sendRedirect(/index.jsp);
 } 
  

 if(request.getParameter(test) == null){
 throw new Exception(Can't Redirect);
 } 
  
  
 %
 
 
 -- 
 Configure bugmail: 
 http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
 --- You are receiving this mail because: ---
 You are the assignee for the bug, or are watching the assignee.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 32811] - sendRedirect does not commit

2004-12-29 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=32811.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32811





--- Additional Comments From [EMAIL PROTECTED]  2004-12-29 18:54 ---
sendRedirect does set the appropriate flags such that calling
response.isCommitted() does return true. For example:

%
response.sendRedirect(cowbell.jsp);
if (!response.isCommitted()) {
   System.out.println(Why am I not committed?);
}
%

But even though the response is committed, an error being thrown can result in
the redirect not being sent to the client - but instead - an error is sent to
the client. Whether this is a bug or not - I am indifferent.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 32811] - sendRedirect does not commit

2004-12-27 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=32811.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32811





--- Additional Comments From [EMAIL PROTECTED]  2004-12-27 18:40 ---
(In reply to comment #1)
 I'm surprised that page compiles in Jetty.
 Doesn't it use the Jasper compiler as well?
 
 AFAIK, sendRedirect and throw statements always need to be 
 contained in a branch if there is any code after them.
 
 I would, however, expect this page to return a redirect instead of 
 a server error.  I tested with 5.0.30 and it compiled but returned a server 
 500
 error.
 
 %
  
 
 if(request.getParameter(test) == null){
 response.sendRedirect(/index.jsp);
 } 
  

 if(request.getParameter(test) == null){
 throw new Exception(Can't Redirect);
 } 
  
  
 %
 

I paraphrased the page for clarity.  Most concise would look something like:
%
response.sendRedirect(/index.jsp):
if (true) throw new javax.servlet.ServletException(redirected);
%


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 32811] - sendRedirect does not commit

2004-12-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=32811.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32811





--- Additional Comments From [EMAIL PROTECTED]  2004-12-23 17:51 ---
I'm surprised that page compiles in Jetty.
Doesn't it use the Jasper compiler as well?

AFAIK, sendRedirect and throw statements always need to be 
contained in a branch if there is any code after them.

I would, however, expect this page to return a redirect instead of 
a server error.  I tested with 5.0.30 and it compiled but returned a server 500
error.

% 

if(request.getParameter(test) == null){
response.sendRedirect(/index.jsp);
}  
   
if(request.getParameter(test) == null){
throw new Exception(Can't Redirect);
}  
 
%


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 32811] - sendRedirect does not commit

2004-12-23 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=32811.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=32811





--- Additional Comments From [EMAIL PROTECTED]  2004-12-23 18:48 ---
If the issue exists, it will be related to the way exceptions are handled, and
only this particular case will be a problem.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]