[ 
https://issues.apache.org/jira/browse/WW-5496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17922084#comment-17922084
 ] 

Günter Paul commented on WW-5496:
---------------------------------

Description of the problem

the filter works without struts. It works with struts if no action is called. 
The problem is probably due to a change in the ServletOutputStream:
[Migrating from 10.1.x to 11.0.x|https://tomcat.apache.org/migration-11.0.html]:
Servlet 6.1 API: The meaning of "write operation" in the context of the Javadoc 
for ServletOutputStream.isReady() has been clarified.

In the course of the processing of the filter (dofilter), it is probably 
written in the original request. After the dofilter routine, 
Response.ISCommitted () returns a "true" (not with Tomcat 10). Therefore, it 
can no longer be written in the original response.

My solution:
I rewritten the response wrapper. This time without "Extends 
Httpservletponsewrapper". I complete the interface HTTPServletponse completely. 
I wrapped most routines with the original response class. The following classes 
are newly implemented
 * public ServletOutputStream getOutputStream() throws IOException
 * public PrintWriter getWriter() throws IOException
 * public boolean isCommitted()

It works.

[~lukaszlenart] I think we should leave the problem until Tomcat 11 runs stable.

> Struts filter and HttpServletResponseWrapper
> --------------------------------------------
>
>                 Key: WW-5496
>                 URL: https://issues.apache.org/jira/browse/WW-5496
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 7.0.0
>         Environment: Tomcat 11
>            Reporter: Günter Paul
>            Priority: Minor
>             Fix For: 7.1.0
>
>
> I've been using a servlet filter for a long time. It removes spaces in the 
> lines (trim()) and line breaks (only for *.action requests).
> The filter is installed in the web.xml before the struts filter. It works 
> very well so far, even with the current Struts 7.0.0-M10 version.
> Until now I was using Tomcat 10. After switching to Tomcat 11, only blank 
> pages are displayed.
> If I use a web-application without struts, the filter works fine. Only when 
> the Struts filter (StrutsPrepareAndExecuteFilter) is installed does the 
> output of the wrapper appear to no longer be included in the output stream.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to