jsp页面加载时出现如下错误:
Message Unable to compile class for JSP:
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
Exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [178] in the generated java file: [D:\tomcat8\apache-tomcat-8.5.34\work\Catalina\localhost\stusv-estudent-main\org\apache\jsp\stusv\newstudents\listsafeguard\addAndEditNewstudentsListSafeguard_jsp.java]
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
因为JSP文件太大了导致此错误。
找到Tomcat安装目录下conf文件夹下的web.xml文件,在如下位置,添加红色字体的参数。
<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>enablePooling</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>mappedfile</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
之后重启Tomcat。