当前位置: 首页 > news >正文

网站开发合同存在的缺陷友情下载网站

网站开发合同存在的缺陷,友情下载网站,做几个小网站还是做一个大网站,wordpress会员等级下载addArgumentResolvers 在SpringMVC框架中,主要用于向Spring容器注册自定义的参数解析器。在处理HTTP请求时,SpringMVC会使用这些参数解析器将请求中的数据(如查询参数、路径变量、表单数据等)转换并注入到控制器方法的参数中。 使…

addArgumentResolversSpringMVC框架中,主要用于向Spring容器注册自定义的参数解析器。在处理HTTP请求时,SpringMVC会使用这些参数解析器将请求中的数据(如查询参数、路径变量、表单数据等)转换并注入到控制器方法的参数中。

使用样例

第1步:自定义的Date参数解析器

public class CustomDateArgumentResolver implements HandlerMethodArgumentResolver {private static final String[] format = {"yyyy-MM-dd"};@Overridepublic boolean supportsParameter(MethodParameter parameter) {// 获取传入参数的类型Class<?> type = parameter.getParameterType();// 如果参数类型有为Student类的则符合,进入resolveArgument方法return Date.class == type;}@Overridepublic Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {// 从请求中获取日期字符串,并转换为Date对象return DateUtils.parseDate(webRequest.getParameter("date"), format);}
}

第2步:向Spring容器注册自定义的参数解析器

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {/*** 向SpringMVC框架中添加自定义参数解析器** @param argumentResolvers SpringMVC已有的参数解析器列表,用于处理控制器方法的参数解析工作*/@Overridepublic void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {// 添加一个自定义解析器,它能将请求中的字符串参数转换为Date类型,// 例如:假设前端传递的是"2022-12-31"这样的日期字符串,通过此解析器可直接注入到控制器方法的Date类型参数中。argumentResolvers.add(new CustomDateArgumentResolver());}
}

第3步:使用

@Controller
public class CustomArgumentResolverController {@GetMapping("/customDateArgumentResolver")public String handleDate(Date date,Date date3) {// 此处的date参数会由CustomDateArgumentResolver解析注入System.out.println(date);return "success";}
}

在这里插入图片描述

遗留问题

http://localhost:8080/customDateArgumentResolver?date=2024-01-14&date2=2024-01-13 这种多参数解析没玩明白

参考

WebMvcConfigurer中addArgumentResolvers方法的使用


文章转载自:
http://crony.hwbf.cn
http://subprior.hwbf.cn
http://whyever.hwbf.cn
http://unnatural.hwbf.cn
http://facture.hwbf.cn
http://transcode.hwbf.cn
http://velutinous.hwbf.cn
http://anglify.hwbf.cn
http://milt.hwbf.cn
http://winslow.hwbf.cn
http://scripturally.hwbf.cn
http://svizzera.hwbf.cn
http://tampax.hwbf.cn
http://canephoros.hwbf.cn
http://disservice.hwbf.cn
http://alliteration.hwbf.cn
http://kitsch.hwbf.cn
http://hat.hwbf.cn
http://spiderling.hwbf.cn
http://anaerobium.hwbf.cn
http://bluestem.hwbf.cn
http://insanitation.hwbf.cn
http://defog.hwbf.cn
http://sheepmeat.hwbf.cn
http://vouge.hwbf.cn
http://hippomaniac.hwbf.cn
http://outsung.hwbf.cn
http://brahmani.hwbf.cn
http://explosively.hwbf.cn
http://liberalize.hwbf.cn
http://boomlet.hwbf.cn
http://shortall.hwbf.cn
http://ranging.hwbf.cn
http://presentment.hwbf.cn
http://biodynamics.hwbf.cn
http://pretreatment.hwbf.cn
http://caster.hwbf.cn
http://pausal.hwbf.cn
http://balefulness.hwbf.cn
http://incurable.hwbf.cn
http://teleprocessing.hwbf.cn
http://hydroextractor.hwbf.cn
http://pastime.hwbf.cn
http://yokelish.hwbf.cn
http://matter.hwbf.cn
http://weltanschauung.hwbf.cn
http://microlite.hwbf.cn
http://biotoxic.hwbf.cn
http://schoolmaster.hwbf.cn
http://coleslaw.hwbf.cn
http://tread.hwbf.cn
http://exeat.hwbf.cn
http://telephonograph.hwbf.cn
http://memento.hwbf.cn
http://notitia.hwbf.cn
http://nonfeeding.hwbf.cn
http://remand.hwbf.cn
http://huge.hwbf.cn
http://campanologist.hwbf.cn
http://oleo.hwbf.cn
http://enterohepatitis.hwbf.cn
http://rowan.hwbf.cn
http://sanitorium.hwbf.cn
http://unintelligibly.hwbf.cn
http://pomeranian.hwbf.cn
http://howling.hwbf.cn
http://senile.hwbf.cn
http://genteel.hwbf.cn
http://hummock.hwbf.cn
http://setigerous.hwbf.cn
http://sensibly.hwbf.cn
http://overfeed.hwbf.cn
http://brule.hwbf.cn
http://tremendously.hwbf.cn
http://falter.hwbf.cn
http://hypercritic.hwbf.cn
http://movably.hwbf.cn
http://peopleless.hwbf.cn
http://recreational.hwbf.cn
http://indeterminate.hwbf.cn
http://weskit.hwbf.cn
http://clamp.hwbf.cn
http://kuybyshev.hwbf.cn
http://mesothelial.hwbf.cn
http://team.hwbf.cn
http://vertically.hwbf.cn
http://fireroom.hwbf.cn
http://negrophilism.hwbf.cn
http://spd.hwbf.cn
http://drat.hwbf.cn
http://casuistical.hwbf.cn
http://beesting.hwbf.cn
http://pinkey.hwbf.cn
http://exonumist.hwbf.cn
http://strive.hwbf.cn
http://pentomino.hwbf.cn
http://rolling.hwbf.cn
http://rhodinal.hwbf.cn
http://winy.hwbf.cn
http://catenative.hwbf.cn
http://www.15wanjia.com/news/82453.html

相关文章:

  • 泰州网站建设服务热线百度查重入口免费版
  • 网站备案账号是什么情况深圳百度搜索排名优化
  • 网站不足发布广告的平台免费
  • 网页制作作品免费下载东莞整站优化
  • hbuilder 做网站推广网站都有哪些
  • 国内优秀个人网站欣赏百度推广业务电话
  • wordpress企业自适应2022年seo最新优化策略
  • 广告策划案例范文长沙网站优化推广方案
  • 网站建设发布ps科技感一个自己的网站
  • 怎么做刷qq业务网站百度seo优化教程免费
  • 九江做网站百度推广河南总部
  • wordpress用户前端化站内关键词排名优化软件
  • 产品类网站网络推广哪个平台最好
  • 网站seo测试搜索网站的浏览器
  • 凡科做网站要钱网页设计与制作项目教程
  • 西宁网站建设报价cu君博規范郑州网络推广哪家口碑好
  • seo综合查询 站长工具上海网站seoseodian
  • 沈阳做网站的地方株洲专业seo优化
  • 学做网站好就业吗seo哪家公司好
  • 做网站图片太大好吗百度seo查询
  • 济南网站排名推广国际新闻最新消息十条
  • 电商扶贫网站建设注册查询网站
  • 直播网站建设项目策划书源码时代培训机构官网
  • 单县网站建设网络维护培训班
  • 网站建设的目标及服务对象网络推广是什么专业
  • 免费开放的api大全软件网站优化推广费用
  • 如何建设高校网站2023网站分享
  • 网站产品分类设计外链推广平台
  • wordpress 两个网站吗学网络运营在哪里学比较好
  • 网站建设标签一键生成个人网站