Could not resolve view with name 'list' in servlet with name 'seckill-dispatcher'如何解决
public String list(Model model) {
List<Seckill> list = seckillService.getSeckillList();
model.addAttribute("list", list);
//测试
return "list";
} 测试部分 ,方法进入执行,最后return的时候 servlet 找不到list
<!-- 配置jsp显示ViewResolver -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewNames" value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp" />
</bean>
你看看你的viewNames是不是配置错误了。。
你要看看你的jsp文件是否放在WEB-INF/jsp文件夹下面。
<servlet>
<servlet-name>seckill-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/spring-*.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>seckill-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>