【发布时间】:2017-12-01 04:41:52
【问题描述】:
我有一个 Spring Boot 应用程序 -
我有一个控制器 -
@Controller("CWOController")
@RequestMapping(value = "/cworequest")
public class CWOController {
@RequestMapping(value = {"/index.html"}, method = {RequestMethod.GET})
public String getCwoIdSearchForm(Model model) {
model.addAttribute("cwoRequestForm", new CWORequest());
return "index";
}
这适用于网址 -> http://localhost:8080/cworequest/
但我需要 -> http://localhost:8080/cworequest/index.html 映射到上面的 GET。
我该怎么做?
【问题讨论】:
-
你能看看下面的链接吗
-
感谢 Praddep...抱歉,我的映射有误。这是它的样子。 @RequestMapping(value = {"/"}, method = {RequestMethod.GET}) public String getCwoIdSearchForm(Model model) { model.addAttribute("cwoRequestForm", new CWORequest());返回“索引”; }
-
现在你能解决了吗?
标签: html spring spring-boot