Unable to compile class for JSP,The code of method _jspService is exceeding the 65535 bytes limit

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。

 

發佈了34 篇原創文章 · 獲贊 14 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章