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

ShallowEtagHeaderFilter setContentLength on include [SPR-11717] #16339

Closed
spring-projects-issues opened this issue Apr 22, 2014 · 1 comment
Closed
Assignees
Labels
type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Apr 22, 2014

Rik Coomans opened SPR-11717 and commented

ShallowEtagHeaderFilter.setContentLength causes an error when rendering a jsp which performs an include:

Caused by: java.io.IOException: JSPException including path '/alg/include/e_footer.jsp'.
        at org.apache.tiles.request.servlet.ServletUtil.wrapServletException(ServletUtil.java:61)
        at org.apache.tiles.request.jsp.JspRequest.doInclude(JspRequest.java:125)
        at org.apache.tiles.request.AbstractViewRequest.dispatch(AbstractViewRequest.java:47)
        at org.apache.tiles.request.render.DispatchRenderer.render(DispatchRenderer.java:45)
        at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:259)
        at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:397)
        ... 65 more
Caused by: java.lang.IllegalArgumentException: New capacity must not be smaller than current size
        at org.springframework.util.Assert.isTrue(Assert.java:65)
        at org.springframework.util.ResizableByteArrayOutputStream.resize(ResizableByteArrayOutputStream.java:65)
        at org.springframework.web.filter.ShallowEtagHeaderFilter$ShallowEtagResponseWrapper.setContentLength(ShallowEtagHeaderFilter.java:217)
        at javax.servlet.ServletResponseWrapper.setContentLength(ServletResponseWrapper.java:159)
        at javax.servlet.ServletResponseWrapper.setContentLength(ServletResponseWrapper.java:159)
        at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:777)
        at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:338)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:832)
        at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:718)
        at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:655)
        at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:940)
        at org.apache.jsp.alg.include.e_005ffooter_jsp._jspService(e_005ffooter_jsp.java:78)

Affects: 4.0.3

Issue Links:

Referenced from: commits 3f392e3, 2f15f72

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Good catch! We're only using a specified content length to grow the buffer now, i.e. we're simply ignoring values smaller than the current buffer size.

Juergen

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

No branches or pull requests

2 participants