웹 개발/설정 및 오류해결
[eclipse error] The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
coding captain
2022. 9. 5. 15:15
Unable to compile class for JSP:
An error occurred at line: [186] in the generated java file: [D:\project\sample\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\work\Catalina\localhost\sampleProject\org\apache\jsp\folder01\folder02\...\sample_jsp.java]
The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit
위와 같은 메시지가 나온다. 참고로 .metadata 는 서버가동시 tomcat 이 실제로 리소스를 읽는 경로이다.
위 경로를 잘 따라가면 그대가 작성한 jsp 파일이 모셔져 있는 것을 확인할 수 있다.
jsp 파일이 읽을 수 있는 65535byte, 즉 64kb 를 초과해서 발생하는 오류이다.
Tomcat => web.xml 파일 => <servlet> 태그에 jsp파일크기를 제한하지 않도록 요소를 추가한다.
<!-- =======생략====== -->
<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을 재시작한다.