What is Tomcat

Materials for learning

What is a server?

In a nutshell, it takes a request and returns a response to it. For example, on a general website, a request called URL is sent to the server and html is received as a response. In programming, when you want to create a server, some languages make it easy to set up a server, but when it comes to Java, that's difficult. So, install the one with the server function in advance and create a server in cooperation with it.

What is Tomcat?

Tomcat is a server function that makes it easy to work with Java Servlet. So let's make a simple Servlet. First, open Eclipse. Note that Java EE is blue under the x button in the upper right corner.

java.PNG

Right-click here → New → Dynamic Project to create a Dynamic Project. Since there is a place to set ProjectName and Target runtime, set it. If Tomcat is not installed, you will need to install Tomcat. Assuming that ProjectName is set appropriately, Target runtime selects the version of Tomcat that you have selected and associates it with the downloaded Tomcat file.

java2.PNG

Press finish when you have finished setting.

java3.PNG

Create a Package with the name main directly under src, and create a new Servlet file with the Class Name Test in it. Both Package creation and Servlet file creation can be performed by right-clicking.

Once created, click below where Servers is written below the image above.

java4.PNG

Then click and select the Tomcat version that is the same as the one you first selected in Target Runtime.

java5.PNG

You can create a server by pressing Add and then Finish.

After that, click the server and click the bug mark to start the server. By default, hitting localhost: 8080 / sample-project / Test will return a response. Execution result java6.PNG

Recommended Posts

What is Tomcat
What is Cubby
What is null? ]
What is java
What is Keycloak
What is maven?
What is Jackson?
What is self
What is Jenkins
What is ArgumentMatcher?
What is IM-Juggling?
What is params
What is SLF4J?
What is Facade? ??
What is Java <>?
What is POJO
What is Java
What is centOS
What is RubyGem?
What is before_action?
What is Docker
What is Byte?
What is Maven Assembly?
What is `docker-compose up`?
What is a constructor?
What is vue cli
What is an interface?
What is Ruby's self?
What is hard coding?
What is a stream
What is Ruby's attr_accessor?
What is Java Encapsulation?
What is permission denied?
What is an initializer?
What is Spring Tools 4
What is an operator?
What is object orientation?
What is Guava's @VisibleForTesting?
What is MVC model?
What is an annotation?
What is Java technology?
What is Java API-java
What is @ (instance variable)?
What is Gradle's Artifact?
What is JPA Auditing?
[Swift] What is dismiss?
[Java] What is flatMap?
What is a Servlet?
What is web development?
[Java] What is JavaBeans?
[Android] What is Context? ??
[Java] What is ArrayList?
What is object-oriented after all?
What is HttpSession session = request.getSession ();
What is docker run -it?
What is Java Assertion? Summary.
[Memorandum] What is an error?
What is DI (Dependency Injection)
What is a wrapper class?
What is object-oriented programming? ~ Beginners ~
What is a boolean type?