Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
terefang opened this issue May 4, 2011 · 1 comment

Comments

@terefang
Copy link

terefang commented May 4, 2011

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;

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

@Kdecherf
Copy link
Contributor

Kdecherf commented May 8, 2011

Hi,

Thanks for the report, we look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants