4

I am trying to run my application but its gives me error at compilation time that code is too large when minimum character exceeds.

So is there any way other than JSP:include or cutting page into parts? how can i set the maximum character limit for JSP page in compilation in glassfish server?

Thanks

Bhushan Sanghavi
  • 65
  • 1
  • 1
  • 6

2 Answers2

5

There is a size limit of Java class (64k), which is described with details in this question: maximum size of java class / exception table

So it's a hard limit, which should not be overriden (if the internal addresses are 2 byte, it could be even theoretically not possible).

In the topic _jspService is exceeding the 65535 bytes limit the recommended solution is to use dynamic includes instead of static:

<jsp:include page="test.jsp" /> 

If you have a lot of Java-logic in your page, move it to Java classes.

If you simply have enormous page, and splitting it to many smaller pages is not an option, you can try to move as much as possible to custom tags.

Community
  • 1
  • 1
Danubian Sailor
  • 1
  • 38
  • 145
  • 223
  • +1 because it emphasizes correctly that if have run out of places to add jsp:include page, split your large jsp into two/move take a chunk of
    and paste into a new jsp and in its place, add That's what is meant by moving/splitting
    – veritas Aug 16 '20 at 14:19
0

You can include one JSP file inside another using:

<jsp:include page="..." />
Himanshu Bhardwaj
  • 4,038
  • 3
  • 17
  • 36