razzi.abuissa.net

Razzi's guide to spring

Spring is a java web application framework. I see it come up then and again so I figure I’ll try to learn it a bit.

And yeah I’m probably missing the distinction between spring boot and spring for now.

what guide to follow

This guide follows the Building an Application with Spring Boot instructions; there is also a Quickstart but as we’ll see it only supports using their web-based initializer and I prefer to use the demo git repository.

creating an application

According to their “Building an Application” guide, there are 2 ways to get a sample application:

If you use the initializer, make sure to add Spring Web as a dependency or it won’t work:

I prefer to use the git repository approach, as there is no need to download and unzip a zipfile.

It’s also tracked in git from the start so you can see your changes easily.

To do that:

$ git clone https://github.com/spring-guides/gs-spring-boot.git
$ cd gs-spring-boot/initial
gs-spring-boot/initial $ ./gradlew bootRun

At this point you can open http://localhost:8080 and get the application:

And you can edit the application at src/main/java/com/example/springboot/Application.java and the controller at src/main/java/com/example/springboot/HelloController.java.

documentation website

https://spring.io/projects/spring-boot

depends on

source code

https://github.com/spring-projects/spring-boot