- 编写web.xml
- 导入网站静态资源
- 设置主页并运行
编写web.xml
web.xml:web相关配置
导入网站静态资源contextConfigLocation classpath:applicationContext.xml org.springframework.web.context.ContextLoaderListener springmvc org.springframework.web.servlet.DispatcherServlet contextConfigLocation classpath:springmvc-config.xml 1 springmvc / CharacterEncodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 CharacterEncodingFilter /*
- resource:一些图片,css,js资源
- jsp:jsp文件
- web.xml:配置文件
- login.jsp登录界面
在web.xml中使用默认的servlet,专门用来处理静态资源请求,防止图片加载不出来。
设置主页并运行default *.css *.js *.png *.gif *.jpg *.jfif
login.jsp
运行截图:



