今天碰到了個比較奇怪的問題,居然是因為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>
本人沒有試過, 不知好不好用....