Abstract
In this chapter, you have gotten a sense for what is involved in setting up a web application using core Spring, Maven, a database, and Spring MVC.
Maven is a great tool that development teams can use to simplify day-to-day development. You can manage your dependencies, ensuring repeatable build processes, and provide a consistent interface for developers on your team to use for interacting with your project.
You’ve also learned about some of Spring’s features, including component scanning, BeanFactoryPostProcessors like the PropertPlaceholderConfigurer, Spring’s namespace support, and more advanced XML configuration management with import declarations. Component scanning is likely the most important of these features, since it allows Spring to locate classes within a specified package structure so that it can manage these components and resolve dependencies appropriately.
The component-scanning feature allows developers to use annotations as hints for Spring. It simplifies the work required to wire dependencies together and even reduces the amount of XML configuration required. For instance, the @Repository annotation should be used to indicate those classes that compose the DAO layer, the @Service annotation can be used to designate those classes that are part of an application’s service façade, and the @Controller annotation denotes the presence of a POJO that should be used for Spring MVC interactions. These annotations simplify the definition of the respective tiers, imbuing layer classes with metadata that helps describe their purpose.
You also saw what’s required to integrate a database into a Spring application using the Apache commons-dbcp library for connection pools or via JNDI if you want to use the datasource offerings from your application container.
In the next chapters, we’ll build out our domain model and integrate Hibernate into our art gallery application.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Editor information
Rights and permissions
Copyright information
© 2010 Paul Tepper Fisher and Brian D. Murphy
About this chapter
Cite this chapter
Fisher, P.T., Murphy, B.D. (2010). Basic Application Setup. In: Anglin, S., et al. Spring Persistence with Hibernate. Apress. https://doi.org/10.1007/978-1-4302-2633-8_3
Download citation
DOI: https://doi.org/10.1007/978-1-4302-2633-8_3
Publisher Name: Apress
Print ISBN: 978-1-4302-2632-1
Online ISBN: 978-1-4302-2633-8
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)