Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Development Lib
>
Microservice
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
849
Star
3.1K
Fork
950
GVP
JbootProjects
/
jboot
Code
Issues
73
Pull Requests
0
Wiki
Insights
Pipelines
Service
JavaDoc
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
jboot(4.1.9)在配置使用Action参数映射时,无法正确获得前端通过POST方式传递的json参数
Backlog
#IBPB71
颜朋
Opened this issue
2025-02-27 11:17
期望的使用方法: ``` @Log4j2 @RequestMapping("/jboot") public class JbootTestController extends JbootController { public void index() { log.debug("run in index...."); renderText("Hello JFinal World."); } //Get method public void test(String name, String password) { log.debug("run in test...."); renderText("Hello JFinal World. " + name + " " + password); } //POST method public void test2(String value) { log.debug("run in test2...."); renderText("Hello JFinal World. " + value); } //POST method public void test3(DemoObj demoObj) { log.debug("run in test3...."); renderText("Hello JFinal World. " + demoObj.toString()); } } ``` Get方式的可以得能Action参数的值。但post方法的,用上面的使用方法都得不到。(备注: 直接使用jfinal, 是可以正常获取json中的参数值的) 操作步骤基本如下: 1. 在实现JbootAppListener的主启动类中,在onConstants()方法中, ``` @Log4j2 public class JbootTest implements JbootAppListener { public static void main(String[] args) { JbootApplication.createServer(args).start(); } @Override public void onConstantConfig(Constants constants) { constants.setResolveJsonRequest(true); } } ``` 2. 通过action来执行,意图获取参数时(/test2方法),得到如下错误提示:  可以看到,是因为jboot在调用jfinal的get方法时,因为类型转换出现了问题,  3. 我看了一下jfinal及jboot的源码,在ActionHandler类中的handle方法中,发现jfinal中有对json的判断处理,但jboot中却没有。不知道是不是因为这个原因导致的? Jfinal:  Jboot: 
期望的使用方法: ``` @Log4j2 @RequestMapping("/jboot") public class JbootTestController extends JbootController { public void index() { log.debug("run in index...."); renderText("Hello JFinal World."); } //Get method public void test(String name, String password) { log.debug("run in test...."); renderText("Hello JFinal World. " + name + " " + password); } //POST method public void test2(String value) { log.debug("run in test2...."); renderText("Hello JFinal World. " + value); } //POST method public void test3(DemoObj demoObj) { log.debug("run in test3...."); renderText("Hello JFinal World. " + demoObj.toString()); } } ``` Get方式的可以得能Action参数的值。但post方法的,用上面的使用方法都得不到。(备注: 直接使用jfinal, 是可以正常获取json中的参数值的) 操作步骤基本如下: 1. 在实现JbootAppListener的主启动类中,在onConstants()方法中, ``` @Log4j2 public class JbootTest implements JbootAppListener { public static void main(String[] args) { JbootApplication.createServer(args).start(); } @Override public void onConstantConfig(Constants constants) { constants.setResolveJsonRequest(true); } } ``` 2. 通过action来执行,意图获取参数时(/test2方法),得到如下错误提示:  可以看到,是因为jboot在调用jfinal的get方法时,因为类型转换出现了问题,  3. 我看了一下jfinal及jboot的源码,在ActionHandler类中的handle方法中,发现jfinal中有对json的判断处理,但jboot中却没有。不知道是不是因为这个原因导致的? Jfinal:  Jboot: 
Comments (
1
)
Sign in
to comment
Status
Backlog
Backlog
Doing
Done
Closed
Assignees
Not set
Labels
Not set
Label settings
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (6)
Tags (284)
master
jboot3.x-restful
v3.0
v2.0
v1.x
1.8.x
v4.1.8
v4.1.7
v4.1.6
v4.1.5
v4.1.3
v4.1.2
v4.1.1
v4.1.0
v4.0.9
v4.0.8
v4.0.7
v4.0.6
v4.0.5
v4.0.4
v4.0.3
v4.0.2
v4.0.1
v4.0.0
v3.17.1
v3.17.0
v3.16.9
v3.16.8
v3.16.7
v3.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3.0
v2.2.8
v2.2.7
v2.2.6
v2.2.4
v2.2.3
v2.2.2
v2.2.1
v2.2.0
v2.1.6
v2.1.5
v2.1.4
v2.1.3
v2.1.2
v2.1.1
v2.1.0
v2.0.9
v2.0.8
v2.0.7
v2.0.6
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v2.0
v2.0-rc.13
v2.0-rc.12
v2.0-rc.11
v2.0-rc.10
v2.0-rc.9
v2.0-rc.8
v2.0-rc.7
v2.0-rc.6
v2.0-rc.4
v2.0-rc.3
v2.0-rc.2
v2.0-rc.1
v1.7.5
v1.7.4
v1.7.3
v1.7.2
v1.7.1
v1.7.0
v1.6.9
v1.6.8
v1.6.7
v1.6.6
v1.6.5
v1.6.4
v1.6.3
v1.6.2
v1.6.1
v1.6.0
v1.5.9
v1.5.8
v1.5.7
v1.5.6
v1.5.5
v1.5.4
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.4.9
v1.4.8
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.3.9
v1.3.8
v1.3.7
v1.3.6
v1.3.5
v1.3.4
v1.3.2
v1.3.1
v1.3.0
v1.2.8
v1.2.7
v1.2.6
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.9
v1.1.8
v1.1.7
v1.1.6
v.1.15
v1.1.4
v1.1.3
v1.1.2
v1.1.1
v1.1.0
1.0
1.0-rc.4
1.0-rc.3
1.0-rc.2
1.0-rc.1
1.0-beta9
1.0-beta8
1.0-beta7
1.0-beta6
1.0-beta5
1.0-beta4
1.0-beta2
1.0-beta1
1.0-alpha4.1
1.0-alpha3
1.0-alpha2
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(1)
Java
1
https://gitee.com/JbootProjects/jboot.git
git@gitee.com:JbootProjects/jboot.git
JbootProjects
jboot
jboot
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register