PROBLEM
There are several layers to a Spring MVC application, and there are many Spring, JPA, and Java artifacts needed to implement those layers. The Skyway Builder Spring DSL simplifies the development of these artifacts through the use of code generation, but there is also an opportunity to generate full applications. Other development platforms, including RAILS and GRAILS, have popularized this approach to application development. Scaffolding consists of generating full applications by applying standard application patterns from a minimal set of inputs provided by the developer. Whether these scaffolded applications are used as-is or as the starting point for additional developer customization, scaffolding is very effective at jump-starting application development.
SOLUTION
Spring MVC scaffolding consists of generating a full Spring MVC application based on the CRUD application pattern. By only defining the domain model, which can consist of one or more related domain objects, the Spring MVC scaffolding engine will create all the web, service, and data layer components for managing the domain objects, including create, read, update and delete.
Starting with a domain object, here's what gets created by Spring MVC scaffolding:
Spring MVC Scaffolding
a model package for the data access object layer
a data access object (DAO)
a set of named queries (JPQL) for the domain object
a model package for the service layer
a Service with CRUD operations
a model package for the controller layer
a Controller with fully implemented CRUD operations
Junits for controllers and
layout managed user interface using Sitemesh
CRUD JSP pages using Spring Form tag library and JSTL
client-side validation implemented Spring JS with DOJO
integration with Spring Security, including a default DB implementation of users and authorities
HOW IT WORKS
Before scaffolding an application the developer must create or import the domain model using the Spring DSL, and the domain model must be contained within a Model Pacakge.
Here are the steps for using the Spring MVC scaffolding:
Steps for scaffolding a domain object:
Right-click on a domain object, and select Scaffolding --> Generate CRUD
RELATED RECIPES