Spring MVC allows this thing then org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping
is active, for example, given config:
<beans ...>
<context:component-scan base-package="some.controllers" />
<bean class = "org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping" />
</beans>
And controller implementation:
package some.controllers;
...
@Controller
public class SampleController {
@RequestMapping
public String hello() {
...
}
@RequestMapping
public String bye() {
...
}
}
URLs /sample/hello
and /sample/bye
will be mapped to the corresponding methods.
For controller/action/parameter kind of mapping controller looks so:
@RequestMapping("/hello/{parameter}")
public String hello(@PathVariable("parameter") String parameter) {
...
}