Ayumilove Develop a Spring Framework MVC Application using NetBeans, GlassFish and MySQL (Step by Step) Dummies Guide to Spring MVC (Chapter 2/6)
Developing a Spring Framework MVC application step-by-step using NetBeans and GlassFish
Authors Thomas Risberg, Rick Evans, Portia Tung
Modified by Ayumilove for the 3 Open Source Softwares below:
NetBeans 6.7 (IDE – Integrated Development Environment to develop web applications and software)
GlassFish (Application Server – Consists of Web Container, JavaBean Container)
MySQL (RDBMS – Relational Database Management System)
Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
The following prerequisite software and environment setup is assumed.
You should also be reasonably comfortable using the following technologies.
* Java SDK 1.5/1.6
* GlassFish V2 UR1 (comes with NetBeans 6.7)
* Spring Web MVC Framework (comes with NetBeans 6.7)
* NetBeans 6.7
Chapter 1 Spring Web MVC Complete Web Application ‘AyumiloveSpring1’ can be downloaded here.
Appendix A. References
Chapter 2 Spring Web MVC Tutorial for Newbies
2.1. Configure JSTL and add JSP header file
2.2. Improve the controller
2.3. Decouple the view from the controller
Chapter 2. Developing and Configuring the Views and the Controller
This is Part 2 of a step-by-step tutorial on how to develop a web application from scratch using the Spring Framework. In Part 1 we configured the environment and set up a basic application that we will now flesh out.
This is what we have implemented so far:
Part 1: index.jsp
An introduction page, ‘index.jsp’, the welcome page of the application.
It was used to test our setup was correct.
We will later change this to actually provide a link into our application.
Part 2: springapp-servlet.xml
A DispatcherServlet (front controller) with a corresponding ‘springapp-servlet.xml’ configuration file.
A page controller, HelloController, with limited functionality – it just returns a ModelAndView.
We currently have an empty model and will be providing a full model later on.
Part 3: HelloControllerTests
A unit test class for the page controller, HelloControllerTests,
to verify the name of the view is the one we expect.
Part 4: Hello.jsp
A view, ‘hello.jsp’, that again is extremely basic.
The good news is the whole setup works and we are now ready to add more functionality.