Spring MVC
文章平均质量分 57
Sprite_柒
这个作者很懒,什么都没留下…
展开
-
对象关联,日期转换,中文乱码问题解决
关联对象赋值这是前端页面我们可以创建delivery实体类来存放,收货人,联系电话,收货地址的值。可以将Form实体类关联起来,并生成getter和setter方法在form中需要申明是delivery的属性在Controller中的代码为,输出收货人的名字。日期类型转换最重要的就是添加注解,这里是在实体类中添加@DateTimeFormat(patter=“yyyy-MM-dd”),也可以直接在接收方法里面添加public String postMapping(String us原创 2022-05-29 10:55:39 · 239 阅读 · 1 评论 -
Controller参数接收,list集合接收数据,map接收数据,接收复合数据
Controller方法参数接收请求参数接收请求参数的常用做法1.使用Controller方法参数接收例如1:<from action="/m1" method="post"> <input name="username"/> <input name="password"/></from>--------------------------------------------------@PostMapping("/m1")@Respo原创 2022-05-27 16:59:34 · 6197 阅读 · 0 评论 -
URl Mapping注解
URl Mapping注解@RequsetMapping —通用绑定@GetMapping --绑定Get请求可以直接响应后直接展示到页面。@PostMapping --绑定Post请求这个不能直接响应,展示到页面上,只能通过表单提交的方式。原创 2022-05-27 15:26:04 · 219 阅读 · 0 评论 -
开始一个Spring MVC项目前的准备工作
开始一个Spring MVC项目前的准备工作原创 2022-05-27 14:53:50 · 125 阅读 · 0 评论