多语言展示
当前在线:1814今日阅读:27今日分享:41

如何设置Web网站首页?

本文讲的是SpringMVC默认首页设置,     使用SpringMVC框架搭建Web,在web.xml中添加 index.htm
方法/步骤
1

使用SpringMVC框架搭建Web,在web.xml中添加

2

SpringMVC使用拦截机制,需要进行Servlet映射,添加一个新的扩展名,总而言之,需要在web.xml中加入以下设置:

3

根据SpringMVC机制,数据被封装成请求后会去寻找相应的控制器(controller),根据你在applicationContext.xml中的设置,寻找控制器的地址,比如:

推荐信息