Skip to content
José Vieira Neto edited this page Dec 15, 2017 · 8 revisions

There are several commands the main one is the scaffold where it generates for you the model, repository, service, controler and the view with thymeleaf.

When running spring scaffold -n "User" -p "name: String email: String"

you will see.

created src/main/java/com/example/model/UserModel.java
created src/main/java/com/example/repository/UserRepository.java
created src/main/java/com/example/service/UserService.java
created src/main/java/com/example/controller/UserController.java
created src/main/resources/layout.html
created src/main/resources/templates/user/index.html
created src/main/resources/templates/user/form.html
created src/main/resources/templates/user/show.html

with this simple command you already have a complete crud (create, read, update, delete).

Another very common command is the spring controller -n "Home"

Output:

created src/main/java/com/example/controller/HomeController.java
created src/main/resources//templates/home/index.html

Files generated:

HomeController.java

Clone this wiki locally