![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringMVC
唯老
这个作者很懒,什么都没留下…
展开
-
1、SpringMVC-基础入门
一、导入SpringMVC <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${sping-version}</version> </...原创 2019-09-07 04:35:35 · 65 阅读 · 0 评论 -
2、web.xml配置
一、web.xml常用配置 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocat...原创 2019-09-07 04:36:06 · 456 阅读 · 0 评论 -
3、DispatcherServlet分发器
一、作用 DispatcherServlet是前端控制器设计模式的实现,提供spring Web MVC的集中访问点,而且负责职责的分派,而且与Spring IoC容器无缝集成,从而可以获得Spring的所有好处 (设计模式一套被反复使用,代码设计方面的经验总结.使用设计模式的主要目的是为了能攻更好的获得可重用行,这包括体系结构和代码实现等方面,并能够让开发者开发出来的软件更容易被他人理解,同事保...原创 2019-09-07 04:37:03 · 621 阅读 · 0 评论 -
4、SpringMVC-RequestMapping
一、作用 这个注解主要作用其实就是一个路径.专业名字叫关系映射.他一般用于 Controller 的类与某个方法中 还有就是对HTTP请求方式进行限定 二、源码 @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Mapping public @interface RequestM...原创 2019-09-07 04:37:35 · 92 阅读 · 0 评论 -
6、SpringMVC-常用注解-请求参数
概要 处理方法参数绑定常用的注解,我们根据他们处理的Request的不同内容部分分为三大类 处理request header部分的注解: @RequestHeader, @CookieValue; 处理request body部分的注解:@RequestParam, @RequestBody; 处理attribute类型是注解: @SessionAttributes, @ModelAttrib...原创 2019-09-07 04:38:59 · 233 阅读 · 0 评论 -
7、SpringMVC-响应内容
一、@ResponseBody(重点) 1、作用 该注解用于将Controller的方法返回的对象,通过适当的HttpMessageConverter转换为指定格式后 2、源码 @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented public @interfa...原创 2019-09-07 20:33:01 · 90 阅读 · 0 评论 -
8、SpringMVC-文件上传
一、导包相关包 <!-- 文件上传核心包 --> <dependency> <groupId>commons-fileupload</groupId> <artifactId>commons-fileupload</artifactId> <version>${fileupload.version}&l...原创 2019-09-07 20:33:11 · 164 阅读 · 0 评论