![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring MVC
Spring MVC开发
读书札记2022
这个作者很懒,什么都没留下…
展开
-
springMVC 解决启动页面时,控制器类System.out.println()输出乱码
一.测试代码:二.不要单独启动页面:单独启动页面的结果:三.要使用tomcat启动:前提是在web.xml中设置tomcat启动访问的页面,如下: <!--设置服务器启动访问的页面--> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list>这样再访问页面index.jsp时,跳转到控制原创 2021-03-13 10:04:58 · 378 阅读 · 0 评论 -
SpringMVC @RequestBody和@ResponseBody注解 以及 Ajax异步请求
实例讲解:1.先创建一个实体类Student:public class Student { private String sname; private String password; private Integer age; public String getSname() { return sname; } public void setSname(String sname) { this.sname = sname原创 2021-03-20 12:21:03 · 240 阅读 · 0 评论 -
SpringMVC restful编程风格 URL
原来在写URL时需要给每个方法配置不同的路径: user类下面的save方法: path="/user/save" user类下面的update方法: path="/user/update" user类下面的findAll方法: path="/user/findAll" 使用restful编程风格的URL时可以给每个方法配置相同的路径, 但是请求的方式不同:GET 、POST 、PUT、DELETE请求,就是 HTTP 协议里面,四个表示操作方式...原创 2021-03-18 09:50:45 · 108 阅读 · 0 评论 -
SpringMVC js/css/img 静态资源失效解决方法 及 Ajax请求失效
因为我们在web.xml配置了前端控制器,拦截了所有请求,所以要在SpringMVC核心配置文件springmvc.xml里开启请求: <!--开启前端控制器不能拦截的静态资源--> <mvc:resources location="/css/" mapping="/css/**" /> <mvc:resources location="/js/" mapping="/js/**" /> <mvc:resources locatio原创 2021-03-20 11:14:06 · 265 阅读 · 0 评论 -
springMVC 解决 “because it is included into a circular dependency(循环导入依赖)” 的问题
java启动项目时报错:Error:Cannot build artifact ‘oauth (1):war exploded’ because it is included into a circular dependency (artifact ‘oauth (1):war exploded’, artifact ‘oauth:war exploded’)解决方案:这是项目中含有和重复的xml文件,删除重复文件即可。将artifacts文件夹下重复的xml删除掉即可—————————————转载 2021-03-13 09:24:58 · 738 阅读 · 0 评论