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
How to build 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]
Spring5 MVC Web App Development with Visual Studio Code Hello World Creation
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
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?
Spring5 MVC Web application development with Visual Studio Code Spring Security usage 2/3 [Page creation 1/2]
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 Java development environment (for Mac)
Build a "Spring Thorough Introduction" development environment with IntelliJ IDEA
Build jooby development environment with Eclipse
Java development environment (Mac, VS Code)
What I learned from doing Java work with Visual Studio Code
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
[Mac] Install Java in Visual Studio Code
Java development environment
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
Build an E2E test environment with Selenium (Java)
Using Gradle with VS Code, build Java → run
Build Spring Boot project by environment with Gradle
[Win10] Build a JSF development environment with NetBeans
Create Spring Boot environment with Windows + VS Code
Build a development environment for Docker, java, vscode
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
I tried to create a java8 development environment with Chocolatey
Java Config with Spring MVC
Use Java included with Android Studio to build React Native
Java development environment (Mac, Eclipse)
Using Mapper with Java (Spring)
Build Spring for Android 2.0.0 environment
Domain Driven Development with Java and Spring Boot ~ Layers and Modules ~