I am migrating a JDK 1.4/JBoss 4.0.2 (yes, it's that old!) application to JDK 8/JBoss 6.4 EAP and am having an issue with one JSP page that is producing the error:
*The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit*
I understand why this is happening and have been working for the last two days on pulling code out of the JSP file with custom tags but it's still happening.
In this midst of this I decided to compare the Java code generated by the old environment that doesn't have this issue with the new environment and I'm seeing that the generated Java file is at least TWICE as large as the old one. A closer look shows that much of the extra is what I'd consider to be very poor optimization of the out.write() method call.
Case in point, I have the following simple code in the JSP:
<html>
<head>
<title>
Nothing special there. In the old generated Java I see:
out.write("\r\n<html> \r\n<head>\r\n<title>");
I think there are some extra spaces after the tag. But when I look at the new file generated by JBoss I see:
out.write("\r\n");
out.write("<html> \r\n");
out.write("<head>\r\n");
out.write("<title>");
So we have 4 out.write calls where only one was needed before. Looking through the code I see this pattern over and over.
I'm looking for any suggestions here. The custom tags are reducing the size of the code but the easy-pickins are gone and I'd rather not completely re-write all 4000 lines of this JSP since, of course, there is no time in the project for that even though it's badly needed.
Any ideas on why the JSP compiling I'm seeing is so terrible and is there any way to swap out the default JBoss 6.4 EAP JSP compiler with a better one?