摘要:
springmvc会按请求参数名和POJO属性名进行匹配,自动为该对象填充属性值,支持级联属性。 User.java package com.gong.springmvc.entities; public class User { private String username; private S 阅读全文
posted @ 2020-01-10 20:45
西西嘛呦
阅读(500)
评论(0)
推荐(0)
摘要:
@RequestMapping(value="/testCookieValue") public String testCookieValue(@CookieValue(value="") String cookie) { System.out.println("cookie="+cookie); 阅读全文
posted @ 2020-01-10 20:28
西西嘛呦
阅读(213)
评论(0)
推荐(0)
摘要:
@RequestMapping("/springmvc") @Controller public class SpringmvcTest { private static final String SUCCESS = "success"; @RequestMapping(value="/testRe 阅读全文
posted @ 2020-01-10 20:23
西西嘛呦
阅读(456)
评论(0)
推荐(0)
摘要:
REST:即资源表现层状态转化。 资源:网络上的一个实体。每种资源对应一个特定的URL。 表现层:把资源具体展现出来的形式,例如文本以txt、html、xml、json或二进制的形式表示。 状态转化:每发出一个请求,就代表了客户端和服务端的一种交互过程,而HTTP请求是无状态协议,即所有的状态都保存 阅读全文
posted @ 2020-01-10 18:52
西西嘛呦
阅读(704)
评论(0)
推荐(0)
摘要:
@PathVariable可以将URL占位符参数绑定到控制器处理方法的形参中。 @RequestMapping("/springmvc") @Controller public class SpringmvcTest { private static final String SUCCESS = " 阅读全文
posted @ 2020-01-10 15:56
西西嘛呦
阅读(737)
评论(0)
推荐(0)
摘要:
Ant风格资源地址支持三种匹配符: ?:匹配文件中的一个字符 *:匹配文件中的任意字符 **:匹配多层路径 ReuqestMapping还支持Ant风格的URL: /user/*/createUser匹配user/aaa/createUser、user/bbb/createUser等URL /use 阅读全文
posted @ 2020-01-10 15:39
西西嘛呦
阅读(202)
评论(0)
推荐(0)
摘要:
@RequestMapping("/springmvc") @Controller public class SpringmvcTest { private static final String SUCCESS = "success"; @RequestMapping(value="testPar 阅读全文
posted @ 2020-01-10 15:32
西西嘛呦
阅读(361)
评论(0)
推荐(0)
摘要:
可以使用method指定请求的方式: package com.gong.springmvc.handlers; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotati 阅读全文
posted @ 2020-01-10 15:05
西西嘛呦
阅读(443)
评论(0)
推荐(0)
摘要:
@RequestMapping不仅可以修饰类,也可以修饰方法。 总而言之,用@RequestMapping标识的是请求的URL地址。例如: package com.gong.springmvc.handlers; import org.springframework.stereotype.Contr 阅读全文
posted @ 2020-01-10 14:58
西西嘛呦
阅读(543)
评论(0)
推荐(0)
摘要:
基础目录如下: 步骤: 1.加入jar包到lib目录下。 2.在web.xml中配置DispatcherServlet:web.xml。 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001 阅读全文
posted @ 2020-01-10 14:48
西西嘛呦
阅读(278)
评论(0)
推荐(0)