So recently I have run into an error that I have never encountered.
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
I set the model attribute in the controller, granted the object is fairly large I wouldn't expect for it to throw an error. I started by limiting the code to figure out what was causing the issue. I have read here to remove the <jsp:include
and use <%@ include
.
Next step I took was to break up the JSP. I realize now that I am building out my Colors and Fonts individually like this
<form:select path="bottom.backgroundColor" class="form-control">
<form:option value="#000000">Black</form:option>
<form:option value="#FFFFFF">White</form:option>
<form:option value="#FF0000">Red</form:option>
<form:option value="#00FF00">Green</form:option>
<form:option value="#0000FF">Blue</form:option>
<form:option value="#F0F000">Yellow</form:option>
<form:option value="#FF7000">Orange</form:option>
<form:option value="#600060">Purple</form:option>
<form:option value="#905030">Brown</form:option>
</form:select>
Removing these items has fixed my issues.
QUESTION: Why? My understanding is that a JSP builds out its own class however it doesn't seem like it took much to break it. Is the problem the size of the modelAttribute that was passed in? It sounds like others have solved issues with loops and such. Can anyone point me to a resource or explain this better? I can supply more code if necessary.