Skip to main content

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 16.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Authors

Editor information

Steve Anglin Tom Welsh Mark Beckner Ewan Buckingham Gary Cornell Jonathan Gennick Jonathan Hassell Michelle Lowman Matthew Moodie Duncan Parkes Jeffrey Pepper Frank Pohlmann Douglas Pundick Ben Renow-Clarke Dominic Shakeshaft Matt Wade Mary Tobin Marilyn Smith

Rights and permissions

Reprints 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

Publish with us

Policies and ethics