相关链接:
http://topic.csdn.net/t/20041111/20/3544983.htmlhttp://www.iteye.com/post/57265http://www.javaworld.com.tw/jute/post/view?bid=6&id=34678&sty=3http://marc.info/?l=struts-user&m=98512887614286&w=2具体问题:
我的JSP文件太大有300多K,这个主要是因为系统一直在维护,很多人因为各种功能需求对这个JSP做了修改,本来编译和运行都是没有问题的,但奇怪的是我只多加了一段HTML代码就出现了这个问题,说了大家可能不信,我只多加了一个<td>kkkee</td>,就出问题了,代码如下:注释的部分是我加的,加了后就出问题:
- <tr>
-
<tdwidth=""CLASS="fmkey"valign="top">BuCode:</td>
-
<tdwidth=""class="fmvalue"align="left">
-
<INPUTTYPE="TEXT"NAME="BuCode"SIZE="23"CLASS="<%=sStyle%>">
- </span>
- </td>
- <td>
-
<INPUTTYPE="BUTTON"NAME=""VALUE="..."CLASS="btnLook"onClick="openLookupGen(arrSetBuCode,arrGetBuCode,'<%=EusUtil.getPage("lookup.generic.bucode.s")%>',arrBuCodeParam,640,480,'yes')">
- sfsfsf
- </td>
- <!--<td>kkkee</td>-->
- </tr>
具体问题如下:
- <<2008-12-1110:19:57.750>>(HttpUtil)ErrorMsg:callpage
-
ExceptionMsg:org.apache.jasper.JasperException:UnabletocompileclassforJSP
-
Anerroroccurredatline:-1inthejspfile:null
- Generatedservleterror:
- [javac]Compiling1sourcefile
-
C:\DOCUME~1\WEIFEN~1\LOCALS~1\Temp\Jetty_0_0_0_0_8080__GeTSmart\Tdec_jsp.java:147:codetoolargefortrystatement
-
try{
- ^
- 1error
- atorg.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:130)
- atorg.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
- atorg.apache.jasper.compiler.Compiler.generateClass(Compiler.java:340)
- atorg.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
- atorg.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
- atorg.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
- atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
- atorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:853)
- atorg.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
- atorg.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
- atorg.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:192)
- atorg.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:129)
- atcom.gobusiness.eus.util.HttpUtil.callPage(HttpUtil.java:225)
- atcom.gobusiness.eus.servlet.CreateDocServlet.doPost(CreateDocServlet.java:365)
- atcom.gobusiness.eus.servlet.CreateDocServlet.doGet(CreateDocServlet.java:76)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:740)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:853)
- atorg.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
- atorg.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
- atorg.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
- atorg.mortbay.http.HttpContext.handle(HttpContext.java:1714)
- atorg.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507)
- atorg.mortbay.http.HttpContext.handle(HttpContext.java:1664)
- atorg.mortbay.http.HttpServer.service(HttpServer.java:863)
- atorg.jboss.jetty.Jetty.service(Jetty.java:460)
- atorg.mortbay.http.HttpConnection.service(HttpConnection.java:775)
- atorg.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
- atorg.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
- atorg.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
- atorg.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
- atorg.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
也有出现这个问题:
(Codeofamethodlongerthan65535bytes)
- ExceptionMsg:javax.servlet.ServletException:org/apache/jsp/Tdec_jsp(Codeofamethodlongerthan65535bytes)
- atorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:853)
- atorg.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
- atorg.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
- atorg.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:192)
- atorg.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:129)
- atcom.gobusiness.eus.util.HttpUtil.callPage(HttpUtil.java:225)
- atcom.gobusiness.eus.servlet.CreateDocServlet.doPost(CreateDocServlet.java:365)
- atcom.gobusiness.eus.servlet.CreateDocServlet.doGet(CreateDocServlet.java:76)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:740)
- atjavax.servlet.http.HttpServlet.service(HttpServlet.java:853)
- atorg.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:360)
- atorg.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
- atorg.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
- atorg.mortbay.http.HttpContext.handle(HttpContext.java:1714)
- atorg.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507)
- atorg.mortbay.http.HttpContext.handle(HttpContext.java:1664)
- atorg.mortbay.http.HttpServer.service(HttpServer.java:863)
- atorg.jboss.jetty.Jetty.service(Jetty.java:460)
- atorg.mortbay.http.HttpConnection.service(HttpConnection.java:775)
- atorg.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
- atorg.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
- atorg.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
- atorg.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
- atorg.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
查了相关的资料:
http://marc.info/?l=struts-user&m=98512887614286&w=2这个帖子解释的比较清楚,还提供了相关的办法
-
Theproblemisthatthereisalimitonthesizeofacompiledmethodina
-
Javaclassfile,andthatlimitiswhatwe'rerunningupagainst.Recall
-
thataJSPpageiscompiledintoaservlet,andintoessentiallyonlyone
-
methodinthatservlet.Hence,ifyourpagecontainsmany,manytags,that
- methodbecomestoobig,andupcomestheexceptionthatyou'reseeing.
主要原因是JAVA文件中对方法有一个大小限制,最大不超过64K,而我的JSP中编译成SERVLET代码的时候就变成了service方法,
这个方法的大小不能超过64K,当JSP文件太大的时候编译成的serviece方法自然就超过了,所以会提供
codetoolargefortrystatement,解决方法有:
- Thereareacoupleof(partial)solutions.
- 1)Breakyourgiantpageupintomultiplesmallerpagesandbringthem
-
togetheratruntimeusing<jsp:include>.Notethat<%@include>won'twork,
-
becausethat'sacompile-timeinclude,whichwillgetyoustraightbackto
- theoriginalproblem.
-
2)Lookforplacestosaveontags.Forexample,the<html:option>tagwas
- recentlyextendedtoallowthespecificationofthetexttodisplay,so
-
thatyoucanreplacethis:
-
<html:option...><bean:messagekey="foo"/></html:option>
-
withthis:
-
<html:option...key="foo"/>
主要有两个解决方法:一个是拆分成多个JSP文件,使用JSP:INCLUDE命令而不是使用<%@INCLUDE%>命令。
第二个是针对使用JSTL或自定义标签的情况,尽量使用产生代码少一些的标签。
在帖子:http://www.iteye.com/post/57265
提到WEBLOG解决了这个问题:- weblogic9解决了这个问题,发布在他上面就不会有任何问题了。我试过了。这个问题也困扰了我们项目组很久。
这个我没有试过。
分享到:
相关推荐
在Linux环境下进行文件操作时,可能会遇到一个名为“Value too large for defined data type”的错误。这一问题通常发生在使用`ls`或`find`命令来查看大于2GB(即2^31字节)的文件时。虽然现代操作系统理论上支持...
delphi7编译慢 或linking阶段会出错 经常会出现内存泄漏或不足 或RLink32.DLL访问出错 直接把bolndmm.dll与rlink32.dll拷贝至delphi7下的bin目录中可以调试了 按网友的说法 新版的内存管理器或连接器 bolndmm.dll...
### 5个方法解决Keil全部编译的问题 在嵌入式系统开发过程中,使用Keil作为集成开发环境(IDE)是非常常见的选择。然而,在实际使用过程中,有时会遇到一个令人头疼的问题——无论何时编译工程,Keil总是执行全部...
将JSP与MySQL相结合,可以构建出高效且可扩展的Web应用程序。本篇文章将深入讲解如何使用JDBC(Java Database Connectivity)驱动程序5.1版本在JSP中连接到MySQL数据库。 首先,我们要了解JDBC驱动程序的作用。JDBC...
Python反编译是将已经编译过的Python字节码(.pyc文件)转换回源代码(.py文件)的过程,这对于理解闭源代码、学习他人代码或逆向工程等场景非常有用。以下是一些关于Python反编译工具的知识点: 1. **什么是Python...
CodeWarrior Development Studio for S12(X) V5.1.
《现代编译原理》(通常被称为“虎书”),是由著名计算机科学家Alfred V. Aho、Monica S. Lam、Ravi Sethi和Jeffrey D. Ullman合著的经典教材,它深入浅出地介绍了编译器设计的各个方面。这本书是许多计算机科学...
JSP到Servlet的转换是JSP生命周期的一部分,JSP页面最终会被编译成Servlet。 5. **MVC设计模式**:为了更好地组织代码,可以采用Model-View-Controller(模型-视图-控制器)架构。在本实验中,模型可能包含试题、...
这个错误通常表明在尝试构建wheel(一种预先编译的Python包格式)时出现了问题。本文将详细讲解这个问题的成因以及解决方法。 ### 问题成因 当`pip`尝试安装一个Python包时,它会首先检查是否有匹配当前环境的预...
5. **IDE集成**:myeclipse反编译插件与jad的结合,使得开发者在遇到无源码的库时,可以直接在IDE中查看类文件的源代码,提高开发效率和解决问题的能力。 6. **使用场景**:反编译插件在调试第三方库、维护旧代码或...
该软件用于java的class文件反编译,实测好用,欢迎大家下载,有问题可以留言。。。。。
此外,使用预编译的`PreparedStatement`代替`Statement`可以防止SQL注入攻击。 总结: 通过JSP将数据库中的数据显示到网页上,主要涉及以下几个关键步骤: 1. 配置JDBC连接,包括数据库URL、用户名和密码。 2. 使用...
2. **交叉编译:** - 描述:在一个平台上编译生成另一个平台上的可执行代码。 - 用途:适用于不同架构间的目标代码生成。 3. **自展:** - 描述:逐步扩展核心语言的过程,从简单的语言开始,逐步添加新特性,...
* A系列:常见错误信息,如Fixed time is too large、Too many attempts have been made、THE SOLUTION APPEARS TO BE DIVERGING等,这些错误信息通常意味着模型存在严重的问题,需要用户检查模型设置和边界条件。...
当使用Smali工具(如baksmali)反编译`classes.dex`时,它会将字节码转换为人类可读的Smali代码。 4. **baksmali.jar**:这是Smali反编译器的二进制版本。它能将`classes.dex`文件分解为一系列Smali源代码文件,...
2. **生命周期**:JSP页面经过编译、加载、初始化、服务和销毁五个阶段。在服务阶段,每次用户请求都会创建一个对应的Servlet实例,处理请求并返回响应。 3. **JSP动作**:JSP提供了一系列的动作标签,如<jsp:...
在使用这些反编译工具时,需要注意以下几点: 1. 不完全还原:反编译的结果可能无法完全匹配原始的`.mq4`代码,可能存在语法错误、变量名混淆或逻辑差异。 2. 法律问题:反编译他人编写的EA可能涉及到版权侵权。...
1. **JDK 1.6.0**:用于编译JSP网页。 2. **Tomcat 6.0**:JSP运行所需的服务器环境。 3. **Dreamweaver 8**:用于创建简单的JSP网页,并实现服务器和数据库的行为控制以及网页设计。 4. **MyEclipse 6.5**:编写JSP...
### JSP写入MySQL数据库方法详解 #### 一、引言 在Web开发领域,Java Server Pages (JSP) 是一种广泛使用的服务器端脚本技术,用于生成动态网页内容。结合MySQL数据库,开发者可以实现数据的持久化存储,进而支持...
在IT领域,C++反编译工具是一种用于分析和理解已编译C++程序的工具。这类工具的主要目的是为了揭示可执行文件(如.exe或.dll)的内部结构,特别是它们的依赖关系和使用的函数接口。下面我们将深入探讨C++反编译工具...