Complete Web Application: Angular Twitter Bootstrap Spring MVC, Data and Security


Posted on November 3, 2013 by

Share it now!

Hello, how are you?

Today we will see how to create a complete Java web application using Spring, Angular, JQuery, Twitter Bootstrap, Tiles, Maven, Tomcat, JPA/Hibernate.

The project that will be done here in this post will be used in another post that I will write, because of this future post, in this post will be described a detailed environment configuration. I will be using linux as my operational system (OS), but almost nothing will change if you use Windows or other OS.

I received a lot of emails asking for a post using Spring in a full web application, all the applications already posted here were using JEE technology (JSF, EJB, JPA). In this post we will see a project using Spring framework with the following modules: Spring MVC, SpringData e Spring Security. We will see how to do internationalization (i18n) with SpringMVC and templates with Tiles framework.

Postgre will be the database used here, but if you want use it with MySQL just add the MySQL jar to the project and change some configuration. In this post will be displayed both Postgre and MySQL configurations.

It is possible to find the source code of this project in the last page of this post, and to make everybody happy, 3 downloading ways will be available in the end of the post. In this post we will focus in the Spring/JPA code and some of the JPS code highlighting the Angular and Bootstrap libraries, all the JSP code, classes and configurations can be downloaded in the last page.

What we will see in here:

Page 02: Environment Setup
Page 03: Creating the project
Page 04: Understanding the “pom.xml”, “log4j.xml” and the “context.xml” files
Page 05: Creating the Spring and the project XMLs
Page 06: Tiles – Page templates
Page 07: Project Model Classes
Page 08: Using SpringData as Repository (DAO); creating User Service
Page 09: Using SpringData as Repository (DAO); creating Contact Service
Page 10: Creating the Controllers
Page 11: Using Restful approach with SpringMVC
Page 12: Understanding the Login, SpringMVC Interceptor and the Security Rules
Page 13: First Contact with Angular.js and the SpringMVC
Page 14: Using Angular.js bind in a HTML table
Page 15: Internationalization (i18n) with Spring
Page 16: Understanding the Twitter Bootstrap role
Page 17: Running the project

Let us get started!

Response to Complete Web Application: Angular Twitter Bootstrap Spring MVC, Data and Security

1 4 5 6
  1. wak joko


    this project runs smoothly as your guides.

    only that i cant login even after added users {admin & user}.

    here’s log from eclipse:

    TRACE [] [] http-bio-8080-exec-10 Publishing event in Root WebApplicationContext:; Authenticated: false; Details: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: 0B0E90275A7A2663BACEF0E3EBA1BC6F; Not granted any authorities]

    • uaihebert Post author

      Hello wak, I am sorry but your log is to big for me to analyse it right now.

      If you have just the error part post it so that I can read.

      Thanks for passing by

  2. Pablo

    Why did you choose using tiles template, being able to use angularjs directives to modularize client side, detaching completely the responsabilites of views to angular?

  3. Dariusz

    I just downloaded your whole app and run “clean install tomcat7:run”.
    I get:
    javax.naming.NameNotFoundException: Name [jdbc/tomcatDataSource] is not bound in this Context. Unable to find [jdbc].

    I didn’t change anything after download, so do I have to make some configuration change?


  4. Arun

    Hi Uaihebert…
    i’m developing login module using Angularjs with MySql database and using spring MVC….
    already developed Ui and java backend coding …
    but i get stuck in calling Rest Service via Angularjs controller using json object ??how can i proceed??

    • uaihebert Post author

      Hello Arun, how are you?

      I am sorry but I cannot help without seeing your code.

      You could post some of your at and ask some help there. In this comment the code would break and get no formatting.

      Thanks for passing by

  5. Gamekathu

    Hi, I am new to maven & spring. Is there is any faster/easier way to add these loads of dependencies in pom.xml? It looks a bit daunting to add all these before starting the project. What I mean to say is this, isn’t there a way to add dependencies on the fly, as Eclipse imports java libraries while writing the class?

    • uaihebert Post author

      Hello Gamekathu, how are you?

      That depends of your IDE. With Intellij you could do it, but with Eclipse I do not know.

      Thanks for passing by.

1 4 5 6

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Current day month ye@r *