因此,我正在处理在 Websphere 7 (JDK 6) 上运行的遗留 servlet 代码。开发环境设置使用Tomcat 6 (JDK 6)。
- 为什么它可以在 Websphere 7 上运行
Tomcat 6 中没有吗?
- 这是否与以下内容有关
应用服务器?
如果你的答案是“是”或“否”。 2,除了分解代码或使用动态包含之外,您在 Tomcat 6 (JDK 6) 上还有解决方法吗?
该计划不同意将静态包含更改为动态包含,主要是因为大多数页面都与业务模型代码(包括应用程序的主模板)耦合。
So I'm dealing with a legacy servlet code that runs on Websphere 7 (JDK 6). Development environment setup uses Tomcat 6 (JDK 6).
- Why does it work on Websphere 7 and
not in Tomcat 6?
- Is this something related to the
application server?
If your answer is yes for no. 2, do you have a workaround for this on Tomcat 6 (JDK 6) aside from breaking down the code or using dynamic includes?
The schedule does not agree with changing static includes to dynamic includes primarily because most pages are coupled with the business model code including the main template of the app.
发布评论
评论(11)
听起来你正在打 64k 方法限制,可能是由于 Tomcat 如何从 JSP 构建类所致。 此页面建议更改您的静态包含,如下所示
:动态包括这样以避免这个问题:
It sounds like you're hitting a 64k method limit, probably due to how Tomcat builds a class out of your JSP. This page suggests changing your static includes like this:
To dynamic includes like this to avoid the issue:
我用完了可以外部化为
jsp:include
的静态 html/jss/css 块(大部分是非静态 html)...您可以放入
web.xml
code>,mappedfile 设置为 false 像这样删除许多静态行,这些静态行不一定是放入包含的好块,但它们加起来可以节省空间:Peter Hart 的 解决方案听起来也是不错的选择。
I ran out of static html/jss/css blocks I could externalize into
jsp:include
(mostly non-static html was left) ...You can put in your
web.xml
, mappedfile set to false like so to get rid of many static lines that aren't necessarily good blocks to put into an include, but they add up to save space:Peter Hart's
<c:catch>
solution sounds like nice option as well.最好直接指出更改位置,如以下链接所述:
https://www.assetbank.co。 uk/support/documentation/knowledge-base/byte-limit-exceeded-error/
找到文件 [Tomcat_Home]/conf/web.xml 并在该文件中搜索“JspServlet”。这应该返回
的 xml 节点,其中包含一些
值。您需要添加一个额外的
,如下所示。这对于 tomcat 用户来说更加清晰和直接
其他参考解决方案当然主要在之前的评论中提到,但都在一个地方阅读,这里: http://answered.site/development-environment-setup-uses-tomcat-6-jdk-6-why-does-it-work/603017/
Tomcat 中也发现了该问题-8 与 JDK1.8 (Java8)
Better to point direct where to change it as stated in following link:
https://www.assetbank.co.uk/support/documentation/knowledge-base/byte-limit-exceeded-error/
Locate the file [Tomcat_Home]/conf/web.xml and search the file for 'JspServlet'. This should return an xml node of
<servlet>
containing some<init-param>
values. You will need to add an additional<init-param>
the same as the below.That's more clear and direct for tomcat user
Other reference solutions that of course, mostly said in previous comment but all in one place to read, here: http://answered.site/development-environment-setup-uses-tomcat-6-jdk-6-why-does-it-work/603017/
The issue also found in tomcat-8 with JDK1.8 (Java8)
有时将 JSP 分解为包含内容没有意义或不起作用。另一种强制 JSP 在编译时分解为单独方法的方法是使用
将 JSP 分成多个段。Sometimes breaking your JSP into includes doesn't make sense or doesn't work. Another way to force your JSP to be broken into separate methods when compiled is to separate your JSP into segments using
<c:catch>
.对于 JBoss eap 6,请在standalone.xml 中的Web 子系统下添加以下代码。
它解决了我的问题。
For JBoss eap 6 in standalone.xml add the below code under web subsytem.
It resolved my issue.
因为它们有不同的 JSP 编译器,可以将 JSP 转换为不同的 Java 代码。 Tomcat JSP 编译器(Jasper)显然无法处理大型 JSP。
不。这些限制是硬连接到类文件的格式/结构中的。
详细信息位于 JVM 规范 中。但它相当复杂,从你的问题中并不完全清楚你达到了哪个限制。 (但这并不重要......它们无法更改。)
Because they have different JSP compilers that translate the JSPs to different Java code. The Tomcat JSP compiler (Jasper) is apparently not able to deal with large JSPs.
No. These limits are hard-wired into the format / structure of class files.
The details are in the JVM spec ... but it is rather complicated, and it is not entirely clear from your question which limit you have hit. (But that is immaterial ... they can't be changed.)
通过将初始化参数“mappedFile”设置为“false”对我有用。
但使用 eclipse 插件有时会被删除,需要在 tomcat home 中重新设置。
By setting initialization parameter "mappedFile" to "false" worked for me.
But using eclipse plugin some time it is getting removed and need to again set in tomcat home.
我今天偶然发现了这个问题
当我使用 Tomcat 8.0.30 而不是 Tomcat 8.0.39 时,我的问题得到了解决
I stumbled across this issue today
My problem was solved as I took Tomcat 8.0.30 instead of Tomcat 8.0.39
如果您要在 带有嵌入式 tomcat 的 Spring Boot 上修复此错误
_jspService is超过 65535 字节限制
,您可以在application.properties 中使用此配置代码>:
If you are going to fix this error
_jspService is exceeding the 65535 bytes limit
on Spring Boot with embedded tomcat you can use this config in yourapplication.properties
:Eidt:给定的解决方案没有解决方案,但错误解释(问题不能在所有 tomcat 版本上重现)抱歉。
Eidt: Given solution was no solution, but missinterpreation (problem can not be reproduced on all tomcat versions) sorry.
对于wildfly服务器,在standalone.xml中->在 undertow 子系统内:将 jsp-config 替换为
For wildfly server, In standalone.xml -> inside undertow subsystem : replace jsp-config with