Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Byte limit Exceed problem when reloading a jsp page?

Tags:

java

jsp

Im new to jsp.I'm getting error is The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit

I am using static include such as

<%@ include file="/jsp/common/createScriptMsg.jsp" %> 

but the page is not loading ... I'd also try dynamiac include such as

<jsp:include page="/jsp/common/createScriptMsg.jsp" /> \

NO LUCK..

Any help would be appriciated.

like image 792
Ganesh Avatar asked Sep 21 '11 07:09

Ganesh


People also ask

Can we extend JSP technology?

JSP technology allows you to introduce new custom tags through the tag library facility. As a Java developer, you can extend JSP pages by introducing custom tags that can be deployed and used in an HTML-like syntax.


3 Answers

We "fixed" this here by setting mappedfile to false for JspServlet in our Tomcat-Config. Go to %TOMCAT_HOME%/conf/web.xml and add the following init-param to the JspServlet:

    <init-param>
        <param-name>mappedfile</param-name>
        <param-value>false</param-value>
    </init-param>

This does not solve the 64 KiB limit but helps in that way that it occurs much later because the generated code is shorter then.

like image 144
Fabian Barney Avatar answered Nov 09 '22 23:11

Fabian Barney


Rather making multiple files i found above mentioned answer's solution more good i-e Adding

<init-param>
        <param-name>mappedfile</param-name>
        <param-value>false</param-value>
    </init-param>

into Web.XML file. but i did not found "JspServlet" in my web.XML file and found a ref link and placed the complete mapping

 <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> 

that worked for me. hope this will help someone.

like image 28
NoNaMe Avatar answered Nov 09 '22 23:11

NoNaMe


I have been having this problem since yesterday, I split my JSP into two JSPs using dynamic include <jsp:include,but it alone didn't help me, Make sure you also add all tags lib and import statement. <jsp:includeworks like a function, So if you are breaking up your JSP in two or more they require same import which you have in your original JSP. Hope it works for you, it worked for me.

like image 2
imtiyaz qureshi Avatar answered Nov 09 '22 23:11

imtiyaz qureshi