使用MAven和Im創建了一個新的Spring MVC項目,其中modelAttributes在jsp頁面上沒有被替換。對於例如,ModelAttributes無法在jsp上訪問
<%@ page session="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html" %>
Hello Worlds ${location} is ${weathers}
<c:out value="${location}"/>
顯示
Hello Worlds ${location} is ${weathers}
${location}
代替
Hello Worlds Omaha is Cold
Omaha
我猜我失去了一個罐子,我已經中MVN依賴列表如下:
<dependency> <groupId>taglibs</groupId> <artifactId>standard</artifactId> <version>1.1.2</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-servlet_2.4_spec</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.4</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.0.7</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>2.5.5</version> </dependency>