Build WebAPP development environment with Java + Spring with Visual Studio Code

Build WebAPP development environment with Java + Spring with Visual Studio Code

In this article, I will explain how to build a Spring Web application development environment using VS Code. The procedure is as follows.

1. Java execution environment construction

As a prerequisite, VS Code requires a Java runtime environment, so if you haven't done so yet, please refer to the article Building a Java program development environment with Visual Studio Code.

2. Extension installation

Open the extension search screen with Ctrl + Shift + x, search for and install the Spring Boot Extension Pack extension. image.png

3. Spring Maven project creation

Open the command palette in the order of display-> command palette in VS Code Shortcut key: Ctrl + Shift + P Type spring: and select Spring Initializr Generate a Maven Project image.png

Select Java image.png

Enter the package name-> ʻEnter` image.png

Enter the project name-> ʻEnter` image.png

Select Spring Boot version image.png

Select the dependencies required for Spring web application development here Since this article explains it as a simple example, add only Spring Web and Thymeleaf.

--Add Spring Web image.png

--Add Thymeleaf

image.png

After adding the above two dependencies, it will be selecled 2 dependencies, click on it Select a save destination image.png A Spring project named demo has been created

image.png

image.png

4, project implementation

Create Controller class in package with XXApplication.java In my case: src / main / java / com / example / demo / DemoApplication.java Select Package-> Right Click-> New File-> DemoController.java-> ʻEnter` image.png

DemoController class is created image.png Edit the contents of DemoController.java

image.png

Create HTML file under resources / templates Right click on templates-> New file-> index.html-> ʻEnter` image.png

Edit the contents of html appropriately Example: If you want to create HTML using bootstrap4, refer to How to write html + bootstrap4 in Visual Studio Code. image.png Open screen: http: // localhost: 8080 image.png The index method of the control class is called and the contents of index.html are displayed on the screen, right? With this, the Spring Web development environment construction is successful.

the end

In future articles, I will write about DB connection, adding other dependencies, editing design files, etc.

Recommended Posts

Build WebAPP development environment with Java + Spring with Visual Studio Code
Build Java program development environment with Visual Studio Code
Build a Java development environment with VS Code
A record of setting up a Java development environment with Visual Studio Code
Build Java development environment with VS Code on Mac
Build Java development environment with WSL2 Docker VS Code
How to build Java development environment with VS Code
[Environment construction] Build a Java development environment with VS Code!
Prepare Java development environment with VS Code
Spring5 MVC Web application development with Visual Studio Code Spring Security usage 1/3 [Preparation]
Spring Boot2 Web application development with Visual Studio Code SQL Server connection
Spring5 MVC web application development with Visual Studio Code SQL Server connection
Spring Boot2 Web application development with Visual Studio Code Hello World creation
Spring5 MVC Web application development with Visual Studio Code Maven template creation
Introduction to Java development environment & Spring Boot application created with VS Code
Spring5 MVC Web application development with Visual Studio Code Environment construction (Installation of JDK11, Maven, Tomcat, Visual Studio Code)
Java in Visual Studio Code
Getting started with Java programs using Visual Studio Code
Why can I develop Java with Visual Studio Code?
Java + Spring development environment construction with VirtualBox + Ubuntu (Xfce4)
Spring5 MVC Web application development with Visual Studio Code Spring Security usage 3/3 [Page creation 2/2]
Use PlantUML with Visual Studio Code
I tried "Visual Studio Code Installer for Java" which can create Java development environment immediately
Java Spring environment in vs Code
Prepare Java development environment with Atom
Java build with mac vs code
Java web application development environment construction with VS Code (struts2)
Build a "Spring Thorough Introduction" development environment with IntelliJ IDEA
Build jooby development environment with Eclipse
Java development environment (Mac, VS Code)
[Oracle Cloud] Create a development environment for OCI Java SDK (Visual Studio Code, Maven, CentOS)
What I learned from doing Java work with Visual Studio Code
Build a PureScript development environment with Docker
Create Spring Boot-gradle-mysql development environment with Docker
Build a Java development environment on Mac
Build Java 8 development environment on AWS Cloud9
Spring Boot + Docker Java development environment construction
Build a Wordpress development environment with Docker
[Mac] Install Java in Visual Studio Code
Java development environment
Try remote debugging of Java with Remote Containers in Visual Studio Code Insiders
Experience .NET 5 with Docker and Visual Studio Code
Add --enable-preview option in Java in Visual Studio Code
Build a WordPress development environment quickly with Docker
[Java] Build Java development environment on Ubuntu & check execution
Using Gradle with VS Code, build Java → run
[Win10] Build a JSF development environment with NetBeans
Create Spring Boot environment with Windows + VS Code
Build a development environment for Docker, java, vscode
[Mac] Install Java in Visual Studio Code (VS Code)
Create a Spring Boot development environment with docker
Java development environment memo
java development environment construction
Build Java with Wercker
Build VS Code + WSL + Java + Gradle environment from scratch
[Mac] VS Code development environment construction (Java, Gradle, Node.js)
Build ruby debug environment with VS Code of Windows 10
Try to build a Java development environment using Docker
Beginners create Spring Tools Suite environment with VS Code
Until you build a Nuxt.js development environment with Docker and touch it with VS Code
Java Config with Spring MVC