1.前端jsp页面设计如图:在测试过程中遇到过引入的js无法加载的问题,原因是在web.xml中配置了拦截了所有的请求,加载js属于静态资源,拦截后会无法加载,解决的方法为:在springmvc.xml配置文件中添加:<mvc:default-servlet-handler />即可。
2.搭建springmvc框架,配置springmvc.xml
3.配置web.xml文件,加载springmvc.xml
4.配置controller:
1.前端jsp页面设计如图:在测试过程中遇到过引入的js无法加载的问题,原因是在web.xml中配置了拦截了所有的请求,加载js属于静态资源,拦截后会无法加载,解决的方法为:在springmvc.xml配置文件中添加:<mvc:default-servlet-handler />即可。
2.搭建springmvc框架,配置springmvc.xml
3.配置web.xml文件,加载springmvc.xml
4.配置controller: