1

I'm getting the following error

_jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit

I know that with Apache Tomcat the following tag in tomcat's web.xml fixes the issue

<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>
    ...
</servlet>

But I'm using embedded tomcat with Spring Boot. So there is no web.xml I'm not sure were this configuration will go or if there is another workaround.

Ujjwal Pathak
  • 646
  • 12
  • 21
  • https://stackoverflow.com/questions/5484253/jspservice-is-exceeding-the-65535-bytes-limit check this out – csk Jan 19 '18 at 07:10

2 Answers2

2

I know this is a late answer but I just stumbled upon same issue with jsp, spring boot and embedded tomcat and below is the simple solution that saved my day.

Add below property in spring boot "application.properties" file and restart the server, it should resolve the problem -

server.servlet.jsp.init-parameters.mappedfile=false
Mohsin
  • 852
  • 8
  • 28
0

Customize JspServlet initparameter mappedfile to false using WebServerFactoryCustomizer<TomcatServletWebServerFactory>.

sample code is below to override customize method of WebServerFactoryCustomizer

public void customise(TomcatServletWebServerFactory factory) {
     factory.getJsp().setInitParameters(..);
}

ideally, you can minimize generated servlet size by avoiding below statement in your JSP

<%@ include file="display.jsp" %>

and by using below

<jsp:include page="display.jsp" />
Bhukailas
  • 47
  • 7