You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
arsenalzjx
changed the title
FastJsonHttpMessageConverter自定义 Long类型的Deserializer不生效,版本1.2.83
FastJsonHttpMessageConverter自定义 Long类型的Deserializer不生效
Feb 4, 2024
场景是想自定义Long,Integer相关的反序列化,以便处理前端输入框中输入abc或者超长转换,导致FastJson直接抛出异常,所抛出异常中无法像Jackson等序列化工具,能够获取转换出错字段,原因等,因此无法给出相对友好提示
在配置中put相关Deserializer替换原有的Long.class和long.class,但无论如何,Long.class的字段反序列化都不会进入到我自定义的CustomeLongCodec中,long.class的情况是可以的,想寻求下如何能够自定义字段的反序列化规则,以下是相关配置代码,CustomeLongCodec只是继承了原有的LongCodec,Override 了deserialze方法
配置 自定义配置FastJsonHttpMessageConverter
配置webconfig
Controller及Test类
The text was updated successfully, but these errors were encountered: