我們使用Spring 3.0.5運行Tomcat 6.0,因爲某些原因我們無法獲得jsps來評估$ {blah}。這是一個Maven項目,包含許多獨立的模塊,Eclipse Helios。Spring和JSP EL未被處理
這裏是我剪斷的web.xml
<web-app id="WebApp_ID" version="2.5"
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">
<display-name>xc.rio</display-name>...
的它是不是這個(<%@頁isELIgnored =「假」%>),因爲當我把這個在我的JSP頁面是僅作爲文本呈現含義
<%@ page isELIgnored="false" %>
<HTML>
...${blah}...
不評估$ {2 + 2}。我也試過這個在tomcat 7上。= - (
更新: 我做了一個獨立的spring和nonspring應用程序和EL作品,我認爲它與viewResolver有關,但那不是它任我猜。
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<mvc:annotation-driven />
<bean id="handlerMapping" class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="detectHandlersInAncestorContexts" value="true" />
</bean>
<mvc:default-servlet-handler/>
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>
嘗試用一個簡單的頁面「$ {2 + 2}」,如果它呈現爲4則這個問題不在Tomcat中 – DwB
它沒有被評估 – arinte
如果你部署了一個簡單的jsp webapp(不是spring),並且$ {2 + 2 },這是呈現爲4? –