struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "victorsosa (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4546) unclosed instantiation of PrintWriter
Date Sat, 02 Jan 2016 17:22:39 GMT

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

victorsosa commented on WW-4546:
--------------------------------

Normally you should not close the stream. The servlet container will automatically close the
stream after the servlet is finished running as part of the servlet request life-cycle. 

So none fix it is needed

> unclosed instantiation of PrintWriter 
> --------------------------------------
>
>                 Key: WW-4546
>                 URL: https://issues.apache.org/jira/browse/WW-4546
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.3.24
>            Reporter: songwanging
>            Priority: Minor
>             Fix For: 2.5
>
>
> In method execute() of class XSLTResult.java (src\core\src\main\java\org\apache\struts2\views\xslt\XSLTResult.java).
> The instantiation of PrintWriter should be closed after all writing is done.
> {code:java}
>   public void execute(ActionInvocation invocation) throws Exception {
> 	…
>  	PrintWriter writer = response.getWriter();
> ...
>  writer.flush(); // ...and flush...
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message