Skip to content

QuercusServletImpl.openWrite(HttpServletResponse response) not robust enough #37

Description

@terefang

hi!

i've encountered a realy nasty misfeature of illegalstateexception in tomcat 7 with jsp includes.

"protected WriteStream QuercusServletImpl.openWrite(HttpServletResponse response)" tries to get an outputstream but the jsp-include implementation in tomcat 7 requieres the jsp-writer to be used.

since i cant currently use git i have included the fix below:

//------------------------------------------------------------------
protected WriteStream openWrite(HttpServletResponse response)
throws IOException
{
WriteStream ws;

try {
    OutputStream out = response.getOutputStream();
    ws = Vfs.openWrite(out);
} 
catch (Exception ex) // Jsp/IllegalState try the writer
{
    Writer out = response.getWriter();
    ws = Vfs.openWrite(out);
}
return ws;

}
//------------------------------------------------------------------

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions