The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit


如果你是通過搜索來到本文的,相信你應該是遇到了如下的錯誤
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
這個錯誤是因為JSP文件太大了導致的。
如果是純粹的Tomcat,找到Tomcat安裝目錄下conf文件夾下的web.xml文件,在如下位置,添加紅色字體的參數。
(D:\Program Files\Apache Software Foundation\Tomcat 6.0\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>mappedfile</param-name>
            <param-value>false</param-value>
        </init-param>
<load-on-startup>3</load-on-startup>
</servlet>
重啟Tomcat,問題基本解決。
為什么說基本解決呢,因為
1、這樣做,只是讓Tomcat不為JSP每行都添加print語句,但是實際上,當文件達到一定程度,還是會發生錯誤,所以最根本的還是盡量減小JSP大小。
TIP:mappedfile : 是否對每個輸入行都用一條print語句來生成靜態內容,以方便調試。缺省為true。

摘自:https://harde.org/blog/2013/06/how-to-fix-the-code-of-method-is-exceeding-the-65535-bytes-limit.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM