You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using context:component-scan with @Controller annotation I get automatic mappings.
For example:
@Controller
public class FormController becomes: /form/*
If I have a request handler in FormController like
@RequestMapping("init.do")
public String init() { }
it gets mapped to /form/init.do
Alright this way.
But if I create another controller like
@Controller public class ContactController {
@RequestMapping("init.do")
public String init() { }
}
it isn't mapped to /contact/init.do as I would expect, but throws the error:
Cannot map handler [formController] to URL path [init.do]: There is already handler [com.company.FormController@f8b79a] mapped.