Error Note

[JSP] The code of method Service() is exceeding the bytes limit

값진 2022. 6. 29. 15:47

문제

The code of method Service() is exceeding the 65535 bytes limit 라는 에러가 생겼다.

JSP의 라인수가 너무 길어 톰캣 오류가 발생한 것이다.

 

해결

web.xml 에서 다음 코드를 추가한다.

JspServlet을 검색해서 init-param 3개를 추가하고, 저장한다음 톰캣을 재시작해 해결할 수 있었다.

 <servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>            
        <param-name>mappedfile</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>genStringAsCharArray</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>trimSpaces</param-name>
        <param-value>true</param-value>
    </init-param>
</servlet>