JSP 表达式不使用 Jetty 进行计算
我花了一天多的时间试图解决这个问题,我查看了相关问题并尝试与 Jetty 的人员进行 IRC 但无济于事。
不久前我们搬到了新服务器,结果发现 JSP 页面无法工作。 JSP 代码显示在浏览器中,而不是计算表达式。
Jetty 网络应用程序标签如下:
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web- app_2_5.xsd"
version="2.5">
Pleeeease,我可以采取哪些步骤来解决这个问题?
I've spent over a day trying to figure this out, I have looked at the related questions and tried to IRC with the guys at Jetty but to no avail.
We moved to a new server a while back and it turns out that the JSP pages don't work. Instead of evaluating an expression the JSP code is displayed in the browser.
The Jetty web-app tag is below:
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web- app_2_5.xsd"
version="2.5">
Pleeeease, what steps can I take to figure this out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您对问题的描述并不是100%清楚。
您的意思是所有 JSP 页面都显示(所有)其代码,而不是正确执行吗?
(我问,因为“JSP 表达式”意味着非常具体的东西,但听起来您正在谈论一般的 JSP 页面)
原因几乎可以肯定是类路径问题。
当 Jetty 启动时,它会尝试确定是否启用了 JSP 支持(很多人在没有 JSP 的情况下运行 Jetty,因此 Jetty 不要求您在运行时启用 JSP 引擎)
如果它找不到工作的 JSP 引擎,然后它将关闭 JSP 支持,您通常会得到您所看到的结果。您通常还会在日志中看到一条与此相关的消息。
听起来好像,当您移动到新服务器时,进行了一些更改以关闭 JSP 引擎。可能这意味着一些必需的 jar 没有安装(或者没有安装到正确的位置),但还有其他原因也可能导致这种情况。
Your description of the problem is not 100% clear.
Do you mean that all JSP pages show (all of) their code, instead of being executed correctly?
(I ask, because "JSP expressions" mean something quite specific, but it sounds like you are talking about JSP pages in general)
The cause is almost certainly a classpath issue.
When Jetty starts, it tries to determine whether JSP support is enabled (a lot of people run Jetty without JSPs, so Jetty doesn't require you to have a JSP engine enabled when you run it)
If it cannot find a working JSP engine, then it will turn off JSP support, and you would typically get the result you're seeing. You would also typically see a message in the logs that says something to that effect.
It sounds like, when you moved to the new server, something was changed to turn off the JSP engine. Probably it means some of the required jars weren't installed (or weren't installed into the right place), but there are other things that can cause it too.