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?
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.
精彩评论