0

When creating a large page, a Summary of all choices made on the ten or more pages before it, I receive the following error:

The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit

From searching elsewhere, I can find this question: Byte limit Exceed problem when reloading a jsp page? but my problem is slightly different. I have no code in the page, beyond (several) c:forEach tags.

It seems to work when I move one of the c:forEach blocks to another jsp and jsp:include it, but the other question implies that this shouldn't work.

I want to make sure I'm not doing some heinous act of coding, so if there's a different solution, I'm open to hearing it.

(I'll reiterate that there is NO business logic code inside this jsp, just c:forEach and c:if tags used strictly to determine if specific sections should be shown. The if tests are simple boolean checks that rely on the servlet to populate the boolean answer that the jsp checks.)

For an example of the if statements in the Jsp that I'm talking about:

Jsp:

<c:if test="${viewOnly==null}">
    <div align="center">
        <input type="button" name="editInfo" 
        title="Update" 
        id="Update" 
        value="Update" 
        class="button" />
    </div>
</c:if>

Java:

if (request.getParameter("view") != null) {
        viewOnly = "Y";
}
mv.addObject("viewOnly", viewOnly);

If it helps, I'm using SpringMVC and Hibernate. (Some spring:message tags were removed from the jsp code and replaced with the actual message.)

Community
  • 1
  • 1
  • The problem isn't with the source code of the JSP file, but the generated .java file. The entire JSP file becomes a method called `_jspService` in a generated class, which then in turn gets compiled into bytecode (.class file). – Brandon Oct 31 '14 at 20:39
  • Suggestion: Find a similar but simpler case and use *javap* to dump the class (or, if you have a way, dump the generated Java). Examine it to see what things cause data to be generated. You can have, eg, large initializations that could do this. – Hot Licks Oct 31 '14 at 20:39
  • Yeah, the problem is that I'm not sure these generated Java/class files stick around for me to actually get a dump of the class. From what I can tell, they are ephemeral and only created when the servlet receives a request for the jsp... I'll dig around and see if I can find it, though. – Wesley Holland Nov 04 '14 at 17:36

0 Answers0