3.2K Star 8.8K Fork 3.6K

GVPJFinal / JFinal

 / 详情

me.setJsonRequestFactory 无法使用自定义的JsonRequest

待办的
创建于  
2023-03-22 11:48

问题:使用自定义的JsonRequest,在WebConfig 的configConstant里,调用setJsonRequestFactory,无法正常设置。

进入源码查看后发现 ActionHandler.jsonRequestFactory 的对象为 BiFunction<String, HttpServletRequest, JsonRequest>,其中 JsonRequest 为实体类,

也就是说 使用自己定义的JsonRequest 必须继承 com.jfinal.core.paragetter.JsonRequest。 因项目中没有使用 com.alibaba.fastjson库,但com.jfinal.core.paragetter.JsonRequest却必须依赖fastjson库,这就造成自定义的JsonRequest无法使用。

建议改进:将 BiFunction<String, HttpServletRequest, JsonRequest> 中的JsonRequest的类型 改为interface以便可使用自定义的JsonRequest

评论 (1)

麦乐 创建了任务

有没有试过子类,之后重写覆盖这个JsonRequest类用到fastjson的方法?

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
Java
1
https://gitee.com/jfinal/jfinal.git
git@gitee.com:jfinal/jfinal.git
jfinal
jfinal
JFinal

搜索帮助