摘要: 类型转换可以将请求参数转换为指定的类型、指定的格式(数据的格式化),然后传给业务方法的参数。 Spring MVC内置了常用的类型转换器。如果内置的类型转换器满足不了需求,可以使用自定义的类型转换。 自定义类型转换有2种方式: 使用Converter 使用Formatter Converter方式 阅读全文
posted @ 2020-01-31 14:14 chy_18883701161 阅读(541) 评论(0) 推荐(0) 编辑
摘要: 接收表单数据有3种方式。 1、使用简单类型接收表单数据(绑定简单数据类型) 表单: <form action="${pageContext.request.contextPath}/userController/handler" method="post"> 用户名:<input name="use 阅读全文
posted @ 2020-01-31 13:15 chy_18883701161 阅读(1720) 评论(0) 推荐(2) 编辑
摘要: 使用注解配置spring mvc (1)spring mvc的配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http: 阅读全文
posted @ 2020-01-31 08:51 chy_18883701161 阅读(1029) 评论(0) 推荐(0) 编辑