Spring Boot 2 With JSP View
Creating a Spring Boot 2 web app just got a lot easier.
Join the DZone community and get the full member experience.Join For Free
In this tutorial, I am going to show you how easy it is to create a web application with Spring Boot 2, along with the
embedded Tomcat + JSP template and JSP views.
What You'll Need
1. Project Structure
You can get the blueprint from the Spring Initializer page.
2. Project Dependencies
3.1 Application Configurations
SpringBootServletInitializer runs a
SpringBootJspApplication from a traditional WAR deployment
4. Controller and View Template
4.1 Create a Controller With Simple Method Handling the Base Request
4.2 Add JSP View as a Template
For JSP files, put in
5. Run With Maven
You can run your application with a bash command at the project root directory:
Then go to
localhost:8080 to test out your application.
All code is available on GitHub.
Published at DZone with permission of Yogen Rai, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.