gpt4 book ai didi

java - 如何进行基于注解的RequestMapping

转载 作者:行者123 更新时间:2023-12-01 15:57:50 25 4
gpt4 key购买 nike

我正在从ajax调用spring Controller ,例如/test/new.ui。如何在 Controller 方法中进行RequestMapping。

提前致谢。

问候,拉朱

最佳答案

@Controller
@RequestMapping("/test/") //This is optional to separate the /test/ part from the new.ui if you want to do other urls under the /test/
public class SomeController {

@RequestMapping("new.ui") //You can also do the entire url fragment here "/test/new.ui"
public Object handleNewMethod(/* ModelAttributes, Errors, RequestParams here */) {
// Code here
}
}

关于java - 如何进行基于注解的RequestMapping,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4742246/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com