[JAVA] Web application development memo with MVN, Tomcat, JSP / Servlet with VScode

Preparation

--Install Java and maven (https://qiita.com/amemolee/items/6f33b8e321cc9395b0cf) -Tomcat for Java Install the plugin in VScode --DL Tomcat (http://tomcat.apache.org/) * Please select the version of Tomcat depending on your environment.

Place Tomcat in any directory

After DLing Tomcat, unzip it and place it in any directory. If it is macOS, it seems better to place it under Applications.

Specify the DL Tomcat for the vscode project

After installing the Tomcat for Java plugin Press Command + P, type > Add Tomcat Server, and press Enter. Select the directory where Tomcat is located.

Run

Make sure pom.xml is generated in the project root and do the following in the project root

mvn install
mvn compile
mvn package

Confirm that the .war file has been generated.

On VSCode, press Command + P, type > Tomcat: Runon Tomcat Server, and press Enter. Select a war file. Refer to the war file and start Tomcat.

With the default settings, it will start at localhost: 8080.

http://localhost:8080 You can check the following screen by accessing.

スクリーンショット 2019-03-21 0.13.19.png

FAQ

I get an error such as the .jar file not found

--Check the path --If you have done mvn install once, run mvn clean and run mvn install again. --It seems that when you do mvn install, it caches the contents executed in pom.xml.

TODO I will write about how to create mvn and JSP / Servlet projects from 0 base later!

Recommended Posts

Web application development memo with MVN, Tomcat, JSP / Servlet with VScode
Comparison of WEB application development with Rails and Java Servlet + JSP
[Probably the easiest] WEB application development with Apache Tomcat + Java Servlet
Until you create a Web application with Servlet / JSP (Part 1)
Create a memo app with Tomcat + JSP + Servlet + MySQL using Eclipse
Start web application development with Spring Boot
Basic Web application creation Servlet / JSP (login function)
Basic Web application creation Servlet / JSP (posting screen)
Basic Web application creation Servlet / JSP (logout function)
About [servlet] [JSP] [tomcat]
Roughly the flow of web application development with Rails.
Web application development article summary
Java web application development environment construction with VS Code (struts2)
Getting Started with JSP & Servlet
Web application built with docker (1)
Spring5 MVC Web application development with Visual Studio Code Environment construction (Installation of JDK11, Maven, Tomcat, Visual Studio Code)
Environment construction for Servlet application development
Passing parameters from JSP with Servlet
Build a web application with Javalin
Hello World with GlassFish 5.1 + Servlet + JSP
Web application creation with Nodejs with Docker
[Java / Eclipse / Servlet / JSP / PostgreSQL] A WEB application framework with data posting / saving / editing / updating / deleting functions
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
Creating a java web application development environment with docker for mac part1
Spring Boot2 Web application development with Visual Studio Code Hello World creation
Spring5 MVC Web application development with Visual Studio Code Maven template creation
Create a java web application development environment with docker for mac part2
Create a simple web application with Dropwizard
Role of JSP in Web application [Java]
Run WEB application with Spring Boot + Thymeleaf
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]
Hello World with Java Servlet and JSP (Easy web server startup with Maven + Jetty)