0

I have a spring boot app -

I have a controller -

@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";
    }

This works on the url -> http://localhost:8080/cworequest/

but I need -> http://localhost:8080/cworequest/index.html to map to the above GET.

How do I do that?

Michael Petch
  • 46,082
  • 8
  • 107
  • 198
Dawn Paily
  • 13
  • 2
  • Can you please look into following link – Pradeep Jun 28 '17 at 05:47
  • https://stackoverflow.com/questions/27381781/java-spring-boot-how-to-map-my-app-root-to-index-html – Pradeep Jun 28 '17 at 05:47
  • Thanks Praddep...Sorry i had the wrong mapping. Here is what it looks like. @RequestMapping(value = {"/"}, method = {RequestMethod.GET}) public String getCwoIdSearchForm(Model model) { model.addAttribute("cwoRequestForm", new CWORequest()); return "index"; } – Dawn Paily Jun 28 '17 at 17:43
  • Now you were able to resolve or not? – Pradeep Jun 29 '17 at 05:24

1 Answers1

0

Add another default method with mapping / and return error or anything else.

mAc
  • 61
  • 4