Disabling the response for futher out

2004-08-27 Thread Derek Richardson
JDK 1.4.2
Tomcat 5.0.19

I'd be ecstatic if someone sheds some light on why I see this in my log:

2004-08-27 10:14:31,324 [http8080-Processor24] DEBUG
org.apache.catalina.core.ApplicationDispatcher -  Disabling the response
for futher output

The context is:

2004-08-27 10:14:31,262 [http8080-Processor24] DEBUG
org.apache.struts.tiles.TilesRequestProcessor -
processForwardConfig(/portlet/md/save.do, false)
2004-08-27 10:14:31,262 [http8080-Processor24] DEBUG
org.apache.struts.tiles.TilesRequestProcessor -   '/portlet/md/save.do'
- processed as uri
2004-08-27 10:14:31,277 [http8080-Processor24] DEBUG
org.apache.struts.action.RequestProcessor -
processForwardConfig(ForwardConfig[name=customize,path=/portlet/md/save.
do,redirect=false,contextRelative=false])
2004-08-27 10:14:31,293 [http8080-Processor24] DEBUG
org.apache.catalina.core.ApplicationDispatcher -
servletPath=/portlet/md/save.do, pathInfo=null, queryString=null,
name=null
2004-08-27 10:14:31,309 [http8080-Processor24] DEBUG
org.apache.catalina.core.ApplicationDispatcher -  Path Based Forward
2004-08-27 10:14:31,324 [http8080-Processor24] DEBUG
org.apache.catalina.core.ApplicationDispatcher -  Disabling the response
for futher output
2004-08-27 10:14:31,324 [http8080-Processor24] DEBUG
org.apache.catalina.core.ApplicationDispatcher -  The Response is
vehiculed using a wrapper:
org.apache.taglibs.standard.tag.common.core.ImportSupport$ImportResponse
Wrapper

I never see the output of /portlet/md/save.do.

Thanks,

Derek Richardson

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



RE: Disabling the response for futher out

2004-08-27 Thread Derek Richardson
Thanks for the code reference. I looked at it and the message I
highlighted is logged immediately after the call to processRequest()
that does the actual forward. processRequest can return without doing
anything and not throw an error in the case that
request.getAttribute(ApplicationFilterFactory.DISPATCHER_TYPE_ATTR) is
null. In Globals (where the constant originates), it is commented
Request dispatcher state. There's a method (matchDispatcher()) which
enumerates some values based on FilterMap, like
FORWARD,FORWARD_ERROR,INCLUDE_FORWARD,INCLUDE_ERROR_FORWARD,REQUEST_FORW
ARD, etc. I would think that, when the code initiates a forward, that
this would be set, but it seems that, in this case, it is not.

It seems to me, naively, that if the forward isn't going to be
performed, that an error should be thrown, or at least a log message
explaining what went wrong. 

Something else I discovered is that, if I do includes instead of
forwards, I see the contents I'm looking for. Unfortunately, I'm using
struts and thus am concerned that there are side-effects to changing the
RequestProcessor to do includes instead of forwards.

In any case, more help is appreciated.

Thanks,

Derek Richardson

 -Original Message-
 From: Shapira, Yoav [mailto:[EMAIL PROTECTED] 
 Sent: Friday, August 27, 2004 2:52 PM
 To: Tomcat Users List
 Subject: RE: Disabling the response for futher out
 
 
 Hi,
 Maybe something is close the response writer?  Maybe
 ImportResponseWrapper is doing that?  Anyways, grep
 http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-catalina/cata
 lina/src/s
 hare/org/apache/catalina/core/ApplicationDispatcher.java?rev=1
 .39view=m
 arkup for Disabling the response if you're interested in the code.
 
 
 Yoav Shapira
 Millennium Research Informatics
 
 
 -Original Message-
 From: Derek Richardson [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 27, 2004 2:28 PM
 To: Tomcat Users List
 Subject: Disabling the response for futher out
 
 JDK 1.4.2
 Tomcat 5.0.19
 
 I'd be ecstatic if someone sheds some light on why I see this in my
 log:
 
 2004-08-27 10:14:31,324 [http8080-Processor24] DEBUG
 org.apache.catalina.core.ApplicationDispatcher -  Disabling the
 response
 for futher output
 
 The context is:
 
 2004-08-27 10:14:31,262 [http8080-Processor24] DEBUG
 org.apache.struts.tiles.TilesRequestProcessor -
 processForwardConfig(/portlet/md/save.do, false)
 2004-08-27 10:14:31,262 [http8080-Processor24] DEBUG
 org.apache.struts.tiles.TilesRequestProcessor -   
 '/portlet/md/save.do'
 - processed as uri
 2004-08-27 10:14:31,277 [http8080-Processor24] DEBUG
 org.apache.struts.action.RequestProcessor -
 processForwardConfig(ForwardConfig[name=customize,path=/portl
 et/md/save
 .
 do,redirect=false,contextRelative=false])
 2004-08-27 10:14:31,293 [http8080-Processor24] DEBUG
 org.apache.catalina.core.ApplicationDispatcher -
 servletPath=/portlet/md/save.do, pathInfo=null, queryString=null,
 name=null
 2004-08-27 10:14:31,309 [http8080-Processor24] DEBUG
 org.apache.catalina.core.ApplicationDispatcher -  Path Based Forward
 2004-08-27 10:14:31,324 [http8080-Processor24] DEBUG
 org.apache.catalina.core.ApplicationDispatcher -  Disabling the
 response
 for futher output
 2004-08-27 10:14:31,324 [http8080-Processor24] DEBUG
 org.apache.catalina.core.ApplicationDispatcher -  The Response is
 vehiculed using a wrapper:
 org.apache.taglibs.standard.tag.common.core.ImportSupport$Imp
 ortRespons
 e
 Wrapper
 
 I never see the output of /portlet/md/save.do.
 
 Thanks,
 
 Derek Richardson
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 This e-mail, including any attachments, is a confidential 
 business communication, and may contain information that is 
 confidential, proprietary and/or privileged.  This e-mail is 
 intended only for the individual(s) to whom it is addressed, 
 and may not be saved, copied, printed, disclosed or used by 
 anyone else.  If you are not the(an) intended recipient, 
 please immediately delete this e-mail from your computer 
 system and notify the sender.  Thank you.
 
 
 -
 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]



Wrapping response causing premature stream closure

2004-01-15 Thread Derek Richardson
I am attempting to wrap the HttpServletResponse to apply gzip compression on data sent 
to the client when gzip is supported. I have written a filter (based on published 
code) that works fine with static content. I, however, have a problem when applying it 
to dynamic content. The dynamic content is written using Struts and it seems to be 
breaking during the tiles includes. However, struts does not seem to be the culprit - 
the same code works fine without the filter.

The problem is straightforward - I receive a java.io.IOException: Stream closed 
message. I am not including the stack trace because, in my mind (which I am out of 
with frustration at this moment), the problem is not where the closed stream is 
detected, but where it is closed. I placed a log statement in my wrapper to dump a 
stack trace when close() is called and this stack trace is included below. It seems 
that close() is being called from 
org.apache.catalina.core.ApplicationDispatcher.doForward(). But my confusion is how my 
wrapper could be causing this closure, since the application works fine without the 
wrapper.

My question is: what could I be doing in the request or output stream wrappers that 
would cause the stream to be closed?

The wrapper source code is also below.

Thanks,

Derek Richardson



2004-01-15 16:34:21,092 [http8080-Processor3] DEBUG com.appiancorp.ap2.Compressi
onResponseStream -  Closing...
java.lang.Exception
at com.appiancorp.ap2.CompressionResponseStream.close(Unknown Source)
at sun.nio.cs.StreamEncoder$CharsetSE.implClose(StreamEncoder.java:431)
at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:160)
at java.io.OutputStreamWriter.close(OutputStreamWriter.java:222)
at java.io.PrintWriter.close(PrintWriter.java:137)
at org.apache.jasper.runtime.JspWriterImpl.close(JspWriterImpl.java:223)

at java.io.PrintWriter.close(PrintWriter.java:137)
at org.apache.jasper.runtime.JspWriterImpl.close(JspWriterImpl.java:223)

at java.io.PrintWriter.close(PrintWriter.java:137)
at org.apache.jasper.runtime.JspWriterImpl.close(JspWriterImpl.java:223)

at java.io.PrintWriter.close(PrintWriter.java:137)
at org.apache.jasper.runtime.JspWriterImpl.close(JspWriterImpl.java:223)

at java.io.PrintWriter.close(PrintWriter.java:137)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationD
ispatcher.java:453)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDis
patcher.java:356)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.
java:1069)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestP
rocessor.java:274)
at org.apache.struts.action.RequestProcessor.processForwardConfig(Reques
tProcessor.java:455)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Ti
lesRequestProcessor.java:320)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
2)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
atcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD
ispatcher.java:575)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis
patcher.java:498)
at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary
.java:822)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.jav
a:398)
at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:13
7)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756
)
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(Inser
tTag.java:881)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)

at org.apache.jsp.portlet_default_jsp._jspx_meth_t_insert_0(portlet_defa
ult_jsp.java:1099)
at org.apache.jsp.portlet_default_jsp._jspService(portlet_default_jsp.ja
va:364)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:2
95)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241