spring-boot-spring-loaded-java8-example
spring-boot-spring-loaded-java8-example copied to clipboard
Example application using spring-boot and spring-loaded with java 8
Spring-boot Spring-loaded java 8 example
This super simple example application shows how to use spring-boot together with spring-loaded, spring-security, Maven and Java 8 to develop standalone application with hot-reloading of changes done to classes and resource files during development.
This makes it as easy and fast to develop in plain java as with grails or Ruby on Rails.
Quickstart
- Clone this git repo
- Open two terminal windows and change to the cloned directory
- In terminal window 1 run:
mvn spring-boot:run
- Open http://localhost:8080/greeting in a browser window. Login with user/password
- Make changes in the GreetingController class and/or the greeting.html template file
- In terminal window 2 run:
mvn compile
- Reload the web page in the browser to see the changes
Instead of manually running mvn compile you can make the compilation from within your favorite IDE as long as:
- The version of the java compiler is the same
- The IDE puts the compiled classes in the target/classes directory
You can even enable auto-compilation if your IDE supports that, for totally seamless development.
Technologies
- Java 8
- Maven
- spring-boot
- spring-loaded
-
spring-security
- Showing how to use @AuthenticationPrincipal to get the details for the currently logged in user
- Thymeleaf
- Thymeleaf Custom Layout - Template layouts in Spring MVC application with no extensions