zoukankan      html  css  js  c++  java
  • jsp文件过大,is exceeding 65535 bytes limit

    今天修改配置项的时候,遇到了一个异常,Generated servlet error:The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit。

    原因:你的jsp编译成的class文件太大。

    有下面几个解决方法:

    尝试修改应用服务器的web.xml文件(在tomcat下位于conf目录下,在jboss下位于serverdefaultdeployjbossweb.sar目录下 ),修改如下图所示之处,加入红框内的初始化参数。 这样确实可以成功,但是,如果你把生产环境下的tomcat都更改,那不是很费时间,还可能出现其他的问题

    所以,还有其他的修改方法,思路就是减少jsp页面的大小。我们可以将jsp页面的标签声明拿到web.xml中去声明。

    具体操作如下:1删除jsp页面中的C标签和fmt标签的引入。 即删除这句话

    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>

    2找到web.xml,增加c标签和fmt标签的配置。

    <jsp-config>
      <taglib>
       <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
       <taglib-location>/WEB-INF/tld/c.tld</taglib-location>
      </taglib>
      <taglib>
       <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
       <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
      </taglib>
     </jsp-config>

  • 相关阅读:
    WebForms和MVC之间的抉择
    RPM install Error: Failed dependencies
    存储NAS和SAN
    python基础31[visualstudio2010来编写python程序]
    Linux系统性能检测
    perl的引用和>
    Linux内存高级 [swap/buffer]
    python类库26[web2py的URL映射]
    python类库31[python的libpath]
    VShpere中创建新Linux(ubuntu)的virtual machine
  • 原文地址:https://www.cnblogs.com/lm970585581/p/8522617.html
Copyright © 2011-2022 走看看