Table of Contents
Click on a link to jump to that section:
- Functional Specs
- Generate OAuth keys
- Spring Social configuration
- Spring Security configuration
- JavaConfig
- ApplicationInitializer.java
- ApplicationContext.java
- DataConfig.java
- ThymeleafConfig.java
- spring.properties
- View with Thymeleaf
- Layers
- Domain
- Repository
- 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.RELEASE
- Spring Data JPA 1.2.0.RELEASE
- Spring Security 3.1.3.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 the following:
- Post to Facebook and Twitter
- Retrieve profile information from Facebook and Twitter
- Secure the application
- Allow login and creation of new users
- Create a page for managing users
Here's our Use Case diagrams:
Screenshots
Before we proceed, let's preview some screenshots of our application:
Sign in page
Sign up
Facebook Profile
Twitter Profile
Manage Users
Post to Facebook
Tweet to Tweeter
Connect to Social Site
Connected to Social Site
Next
In the next section, we will show how to generate the OAuth secret keys for Facebook and Twitter. Click here to proceed.|
Share the joy:
|
,%20%5BUser%5D-(Post%20to%20Twitter),%20%5BUser%5D-(Retrieve%20info%20from%20Facebook),%20%5BUser%5D-(Retrieve%20info%20from%20Twitter),%20%5BUser%5D-(Sign%20in),%20%5BUser%5D-(Sign%20up).png)
,%20%5BAdmin%5D-(Delete%20users),%20%5BAdmin%5D-(Add%20users).png)









I am great fan of you. I learnt spring hibernate just because of your tutorials.
ReplyDeleteThanks a lot. I keep waiting every weekend to see new post of you
dileep, thanks for the support. I will try my best to make new ones, but sometimes real life projects take a good chunk of my time :)
DeleteHi
DeleteI want only to know how to parse json array or any object in jqgrid table with one to many relation table as same in hibernate one to many sample. I am having problem when parsing data for one person to many credit card. If you get time then post only parsing logic.
Best tutorial of the year about Spring Security + Thymeleaf + Social
ReplyDeleteI'll be your big fan too!
Thank you!
i will be good fan of you i am daily browse your blog
ReplyDeleteBEST TUTORIAL BLOG I HAD EVER VISITED....
ReplyDeleteI AM BEGINNER TO ANY FRAMEWORK ,SO I NEED YOUR MORE SUGGESTIONS IF YOU CAN AND I AM ADDICTED TO JAVA RELATED STUFFS...
Thanks for all your tutorial. It really helped me love Spring.
ReplyDeleteDo you have any Spring Security + Struts Integration Tutorial? Or do you know a good source. I kinda in confusion with that matter.
Thanks for your detailed explanation! I wanted to try out your app, but was stopped by this error:
ReplyDelete(default-war) on project spring-social-tutorial: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
when doing 'mvn clean install -e' I understand that the WebAppInitialzer replaces web.xml so not sure why this error is showing up. Any sugestions?
No worries. I set failOnMissingWebXml to false in your pom and now it works.
DeleteI've said it before and I'll say it again :: Mark You Need to Write a Book on learning the SpringFramework ... You are a great tut writer .... and I have nearly every_single_good_book on spring ....
ReplyDeleteThanks Buddy ...
EJB
Edward, thanks for the comment. You know I'm really thinking of writing a book, but I think I can approach more people if I write on the web, and the content will be open to comments and suggestions. I was approached once to lead a book on Spring-related cookbook but I have to turned it down because of time constraints. I just got a new work here in Chicago :-)
DeleteNo problem Mark ... I find it quite awesome of you to write these ... I'd move cross country to get a good gig developing in Spring. I've worked with a lot of different web-frameworks and Spring is my favorite thus far. I like nearly every aspect about it (shameless pun) ...
ReplyDeleteThanks again Mark look forward to more when you get time ...
;-)