今天碰到了个比较奇怪的问题,居然是因为JSP太大导致文件编译不了,上网查了一下,把解决方法贴下来,以供以后参考:
The problem is that there is a limit on the size of a compiled method in a
Java class file, and that limit is what we're running up against. Recall
that a JSP page is compiled into a servlet, and into essentially only one
method in that servlet. Hence, if your page contains many, many tags, that
method becomes too big, and up comes the exception that you're seeing.
There are a couple of (partial) solutions.
1) Break your giant page up into multiple smaller pages and bring them
together at run time using <jsp:include>. Note that <%@include> won't work,
because that's a compile-time include, which will get you straight back to
the original problem.
2) Look for places to save on tags. For example, the <html:option> tag was
recently extended to allow the specification of the text to display, so
that you can replace this:
<html:option ... ><bean:message key="foo"/></html:option>
with this:
<html:option ... key="foo"/>
More info pls access this link: Solution
我就是用了第一种方法解决的,之前include JSP的时候用了%@include, 后来用了<jsp:include>就不会用问题了.顺便贴一下两者的区别:
后记:网上还有一种Solution:
try giving this in the deployment descriptor.
<jsp-param>
<param-name>noTryBlocks</param-name>
<param-value>true</param-value>
</jsp-param>
本人没有试过, 不知好不好用....