Friday, January 20, 2012

Spring MVC 3.1 - Implement CRUD with Spring Data MongoDB (Part 4)

Review

In the previous section, we have implemented the Java classes and organized them in various layers. In this section, we will write the configuration files, which are mainly XML documents.


Configuration

To enable MongoDB repository, including template support, we have to declare the following beans:
  • a Mongo repository
  • a Mongo host
  • a Mongo template
  • Optionally, we declared an InitMongoService to automatically populate our database with sample data


For MongoDB connection, we've extracted the database properties in a separate file.


Finally, here's our applicationContext.xml file

Next

In the next section, we will create the HTML and JavaScript files. Click here to proceed.
StumpleUpon DiggIt! Del.icio.us Blinklist Yahoo Furl Technorati Simpy Spurl Reddit Google I'm reading: Spring MVC 3.1 - Implement CRUD with Spring Data MongoDB (Part 4) ~ Twitter FaceBook

Subscribe by reader Subscribe by email Share

3 comments: