/spring-mvc3-javaconfig

A Java Spring MVC 3 app configured without XML. Also uses Servlet 3 API to bypass web.xml

Primary LanguageJavaScript

Spring @MVC 3.1 Java config

This is a simple example that uses Spring's Java configuration instead of XML. This example is explained in my blog post.

This is a fake login app. In real life you'd probably use Spring Security instead.

There is a service and data access layer, but the repository is just a hard coded stub. It would be simple to modify this to use Spring Data. (See next blog...)

The JSP pages are written in HTML5. The pages use [Twitter Bootstrap] (http://twitter.github.com/bootstrap/) for layout and CSS styling. Take a look at the login form and you won't see the typical table tags used for layout. For compatibility with older browsers, Modernizr is used.

This project also uses the Servlet 3.0 ability to replace web.xml

Maven

The pom.xml requires Maven 3. Some dependencies/plugins aren't needed in this project (e.g. the persistence libraries) but are there for easy migration.

You can run the project with Jetty. The Tomcat 7 plugin is a bit flaky, but the "real" Tomcat 7 works fine.

mvn jetty:run

The site plugin with several reporting plugins is also configured. Take a look at src/site.

mvn site

Resources