标签:
<!-- 注解驱动 --> <mvc:annotation-driven/> <!-- 静态资源,图片 --> <mvc:resources location="/images/" mapping="/images/**"/> <!-- 自动扫描controller --> <context:component-scan base-package="cn.test.springmvc.web.controller"/> <!-- 内部资源视图解析器 前缀+逻辑名+后缀 /WEB-INF/jsps/index.jsp --> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsps/"/><!-- 前缀 --> <property name="suffix" value=".jsp"/><!-- 后缀 --> </bean>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <h1>用户列表</h1> <table border="1"> <tr> <td>编号</td> <td>姓名</td> <td>年龄</td> <td>图片</td> </tr> <c:forEach items="${personList}" var="p"> <tr> <td>${p.id}</td> <td>${p.name}</td> <td>${p.age}</td> <td><img src="${pageContext.request.contextPath}/${p.photopath}"/></td> </tr> </c:forEach> </table>
标签:
原文地址:http://www.cnblogs.com/52hadoop/p/5699643.html