Well, adding a controller is as easy as adding a class annotated with
@Controller
And specifying the package to be scanned from applicationContext.xml, which, in turn, is specified in web.xml. Something like that:
<context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/appServlet/applicationContext.xml </param-value> </context-param>
in web.xml
Then in / WEB -INF / spring / appServlet / applicationContext.xml:
<context:component-scan base-package="your.package" />
Of course you need the actual schema in your application Context.xml
xmlns:context="http://www.springframework.org/schema/context"
And at the circuit address:
http://www.springframework.org/schema/context/spring-context-3.0.xsd
And then the class:
package your.package ..... @Controller MyController{ .....
source share