About: In this tutorial I will show you, how to write Spring webapplication from the scratch and we will do it with step-by-step approach. Maybe you’ve already tried some Spring but you didn’t have the opportunity or will to use more than one particular Spring technology. Maybe you gave up because it looked hard to get all the libraries correct. Don’t worry, we will go together through every step and create working application from the scratch.
Targeted audience: Java programmers. If you’re new to Spring, I hope this will help you to start with Spring development. We will specifically look at assembling complete application with handful of technologies.
Prerequisites: You should be familiar with Java programming language. You will require some general knowledge about web applications, Servlet technology, SQL, REST, ORM , unit testing and dependency injection. We won’t go too deep in any of those, but if something is new to you please check at least some wiki pages or presentations or maybe even tutorials.
List of chapters:
- Part 1 – Designing the domain model
- Part 2 – Persistence layer with Hibernate
- Part 3 – DAO and Service layer
- Part 4 – Spring MVC part 1
- Part 5 – Spring MVC part 2
- Part 6 – AOP support
Technologies we will use:
- Spring 3.1 – as Dependency Injection container, as MVC application framework, to simplify lot of boiler plate code …
- Hibernate – for persistence layer
- MySQL – as our database. If you’re familiar with Hibernate, feel free to use other database if you want, because we will be generating our schema from the entities.
- Maven – for managing dependencies on libraries
- Tomcat – as our web server
Tooling: I don’t want to make you use any specific IDE – feel free to choose any! Just make sure, it has Maven support and that you have installed everything properly. I will be using IntelliJ IDEA, but also SpringSource Tool Suite to make sure I am able to finish tutorial also in other IDE.
What you will NOT find here:
I’ll try to show you most commonly used technologies in today’s enterprise development. That means, how do applications looks today. There are lot of “cooler” projects from SpringSource that have buzz now (like integrating with NoSQL databases or social networks), but we won’t cover those in this tutorial.
About the sources:
If you will be following this tutorial step-by-step and copying sources from the listings, don’t forget to use following icon, that will bring up editor with plain text. So the code will look as in my IDE, unlike as in listing component which sometimes makes the code look messy.
So enough of talking, let’s get started!