Tagged: #tomcat

How to change the default deploy directory of Tomcat in Eclipse

By default, web applications are deployed under this path: “WORKSPACE/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps” . Here below we define the needed steps to change the default deploy directory of Tomcat in Eclipse. 1- Custom Deploy Directory Follow the steps below to change the default deploy directory of Tomcat in Eclipse. Open servers view Double-click on tomcat server, the following overview tab is opened: Select “use custom location”...

How to serve static resources in a web application

In any web application, there exists a folder named WebContent that automatically holds .class and jar files. When running a web application in eclipse or when deploying a war file to an external Tomcat, all that Tomcat needs is the WebContent folder. In this tutorial, we show 2 ways for serving static resources in a web application. 1- WebContent The standard way for...

How to change the default port of Spring Boot application

By default, Spring Boot applications run on an embedded Tomcat via port 8080. In order to change the default port, you just need to modify server.port attribute which is automatically read at runtime by Spring Boot applications. In this tutorial, we provide the common ways of modifying server.port attribute. 1- application.properties Create application.properties file under src/main/resources and define server.port attribute...

Build REST Web Service using Spring Boot

This tutorial provides a step-by-step guide on how to build a restfull web service using Spring Boot. Prerequisites: Eclipse IDE (neon release) Maven 4 Java 1.8 1. Create maven web project Open eclipse then create a new maven web project and name it as SpringBootRest. The structure of the generated project looks like the following: 2. pom.xml After creating the web project, the...

Create a Web Application With Spring Boot

This guide shows how to create a simple MVC web application using Spring Boot. Prerequisites: Eclipse IDE (neon release) Maven 4 Java 1.8 1. Create maven web project Open eclipse then create a new maven web project and name it as SpringBootWebJsp. The structure of the generated projects look like the following: 2. pom.xml After creating the web project, the...

Deploy JAX-WS service on tomcat

This tutorial provides a step-by-step guide on how to build and deploy JAX-WS web service on Tomcat. Throughout this tutorial, we create a very simple SOAP web service and finally deploy it on Tomcat application server. Prerequisites: Eclipse IDE (Neon release) Java 1.8 Apache Tomcat 8 1. Create Maven web project Create a maven web project using this tutorial and name your...

Deploy Spring Boot application on external Tomcat

Spring Boot provides an embedded servlet container which makes it very easy to setup and deploy web applications, by default all Spring Boot applications are exported as a runnable jar file and developers would only need to run this jar file on a java environment without the need to worry about installing and setting up servlet containers. However, the embedded...

Build REST web service using Spring

This tutorial provides a step-by-step guide on how to build REST web service using Spring framework. Prerequisites: Eclipse IDE (Mars release) Java 1.8 Apache tomcat 8  1. Create Maven web project Create a maven web project using this tutorial and name your project as SpringRestService. The structure of the generated project looks like the following: 2. Add Spring dependencies After creating...

How to create a web project using Maven in Eclipse

In this tutorial, we provide a step-by-step guide on how to create a web project using Maven in Eclipse. Prerequisites: Eclipse IDE (Mars release) Java 1.8 Apache tomcat 8 1. Step-1 Open eclipse, then select File -> New -> Maven Project. 2. Step-2 In the next screen, select the workspace of the project and keep the other options as default then...

How to setup Tomcat in Eclipse

In this tutorial, we provide a step-by-step guide on how to setup and configure Tomcat in Eclipse. Prerequisites: Eclipse IDE (Mars release) Java 1.8 Step-1 Download and install Apache Tomcat 8 using this tutorial. Step-2 Open eclipse, Window -> Show View -> Other -> Servers Click “OK”. Step-3 Inside Servers view, right click -> New -> Server -> Tomcat v8.0...