tags:

views:

152

answers:

2

I have added some 10 lines of code in the existing jsp file. When i execute the application received the error called " too large to compile....".

After I googled, it seems some size issue that file should be <64K size. Then i removed some 20 - 30 lines of commentted code in the existing jsp file and tried run the application but still iam getting the same error.

Apart from commentted line code, is there any other code to be removed to reduce the size less than <64K?. I cannot split the file into smaller also. Pleas help me to debug this issue.

+2  A: 

The 64k limit you mention is probably the size of the method generated to represent your JSP. It does not mean that your JSP must not be smaller than 64k.

The only cases where I ever saw that were absurd cases where arrays with tens of thousands of elements were initialized in a single method (which is almost always a sign that the data needs to be outside the code anyway).

Does your JSP contain things like that?

How big is your JSP and what exactly prevents you from splitting it into smaller parts?

Joachim Sauer
+1  A: 

If you really really can't reduce the size of your code, i suggest you to split your jsp in different chunks, "joining" them using dynamic includes (jsp:include).

Another thing, don't put your logic inside your jsp; try to use MVC moving the logic to some business object handled by servlet. Use your jsp just for the view part of the architecture.

systempuntoout