O'Reilly logo

Hands-On High Performance with Spring 5 by Dinesh Radadiya, Prashant Goswami, Pritesh Shah, Subhash Shah, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a Spring application context

After configuring the DispatcherServlet in web.xml, let's move ahead to create a Spring application context. For that, we need to add the following XML code in the spring-mvc-context.xml file:

<beans><!-- Schema definitions are skipped. --><context:component-scan base-            package="com.packt.springhighperformance.ch4.controller" /><mvc:annotation-driven /></beans>

In the preceding XML code, we first defined a component scan tag, <context:component-scan />, for the com.packt.springhighperformance.ch4.controller package, so that all of the beans and controllers get created and autowired.

Then, we have used <mvc:annotation-driven /> to register automatically different beans and components that includes request ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required