Table of Contents
Click on a link to jump to that section:
- Functional Specs
- Creating the View
- HTML Mockup
- Thymeleaf Integration
- JavaConfig
- ApplicationContext.java
- SpringDataConfig.java
- ThymeleafConfig.java
- ApplicationInitializer.java
- Layers
- Domain
- Service
- Controller
- Running the application
- Clone from GitHub
- Create the Database
- Run with Maven and Tomcat 7
- Run with Maven and Jetty 8
- Import to Eclipse
- Validate with W3C
Dependencies
These are the main Maven dependencies:
- Spring 3.2.0.RC1
- Spring Data JPA 1.2.0.RELEASE
- Thymeleaf 2.0.14
- Hibernate 3.6.3.Final
- See pom.xml for full details
Required Tools
These are the minimum required tools:
- Git
- Maven 3.0.4
- MySQL
- Eclipse IDE or SpringSource Tool Suite (STS)
GitHub Repository
There are two versions of the application: a JavaConfig-based and an XML config-based app. Both versions are identical in their feature set.
Functional Specs
Our application's requirements are quite straightforward:
- Create a simple form to manage user information
- Provide the following fields: first name, last name, username, role
- Username must be unique
- Provide CRUD operations
- Provide table to view all users
Here's our Use Case diagram:
Here's a screenshot of our working application:
Next
In the next section, we will focus on the view layer. We'll start writing the HTML mockup template; then we'll integrate it with Thymeleaf. Click here to proceed.|
Share the joy:
|
,%20%5BUser%5D-(View),%20%5BUser%5D-(Update),%20%5BUser%5D-(Delete).png)

Thanks for the nice and comprehensive example.
ReplyDeleteIf possible, please give a sample for Java Config based Spring Security 3.2 or let me know, how to configure Spring Security 3 using Java annotation.
Thanks in advanced....
Rahi, you're welcome. I'm actually on the process of writing a guide that covers the latest Spring Security in a Spring Social app. It uses JavaConfig and no web.xml. Unfortunately, the declaration of the rules (i.e spring-security.xml) will remain in XML because it's easier and less verbose than with JavaConfig.
DeleteYeah...Thanks a lot Mark..Your Spring Social example is very comprehensive and helpful.
Delete