要求是启动服务器,在浏览器直接输入ip和端口号访问首页
1.web.xml中配置:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
2.Controller中写法:
@Controller
public class IndexController {
@RequestMapping(value = "index")
public String index() {
return "index";
}
}
3.springmvc.xml:
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
4.webapp目录结构:
5.但是,访问http://localhost:1012的时候,会出现
如果使用tomcat插件则相应正常,请问大家这是什么原因?
我也遇到这个问题了,你解决了吗?很烦躁啊,一个上午都在搞这个还没知道究竟是怎么回事