There are actually two different things happening here:
- mapping between urls and controllers
- defining controllers as spring beans
For # 1, if you defined ControllerClassNameHandlerMapping as you did, it is about displaying a URL-to-controller. For example, http://example.com/context/home -> HomeController
For # 2, you can define a beans controller as you did. Or you can follow the path of using Spring 2.5 annotations for @Controllers and automatic posting, which eliminates the need for XML bean definitions. Or not, the choice is up to you.
, , ControllerClassNameHandlerMapping, URL- . .
, , , , - DefaultRequestToViewNameTranslator:
<bean id="viewNameTranslator" class="org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator"/>
UrlBasedViewResolver:
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
</bean>