Introducing Spring Boot

Setting up an enterprise spring-based application has become a tedious and error-prone task due to the required bulky configuration along with the complicated dependency management especially if we’re talking about applications which make use of several third party libraries. Each time you build an enterprise spring-based application, you have to repeat the same configuration steps: Import the required spring modules...

How to setup java on unix

This is a step-by-step guide to install java (JRE) on unix machine. Step-1 Download Java Download the appropriate tar.gz JRE package from oracle, choose the package which suits your system specifications (x86 for 32 bits) (x64 for 64 bits) and copy it to your user directory .i.e. /home/PG P.S: if you install x86 version on 64 bit environment, java may not consume the...

How to setup java on windows

This is a step-by-step guide to install java (JRE) on windows machine. Step-1 Download Java Download the appropriate JRE package from oracle, choose the package which suits your windows specifications (x86 for 32 bits) (x64 for 64 bits). P.S: if you install x86 version on 64 bit environment, java may not consume the dedicated amount of memory, it happened to...

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...

Building REST web service using RESTEasy

RESTEasy is yet another popular framework which implements JAX-RS specification and is widely used for building REST web services in java. In this tutorial, we provide a step-by-step guide for building a REST web service using RESTEasy framework, we provide different ways to configure RESTEasy with both Servlet 3.0 and Servlet 2.0. If you’re interested in Jersey, check this tutorial. Prerequisites: Eclipse IDE...

Building REST web service using Jersey

Since Java 5, JAX-RS specification has been announced in order to support building REST web services according to the REST architectural pattern. JAX-RS is a set of interfaces or APIs which provides the building blocks for building REST services in java. Although you can’t build a fully functional RESTful service using these interfaces, there exists a lot of popular frameworks...

forward() vs sendRedirect() vs include()

It is a common practice that a controller redirects to another resource after processing a request, the resource could be either a view which displays the result of processing or even another controller which needs to do further processing on the request. In this tutorial, we explain the different ways of redirecting requests from servlet to another resource. Basically we...

Pass data from servlet to jsp

JSP is mostly used as the view component in any java-based MVC application, its main usage is to present dynamic data processed and generated from server-side controllers like servlet. In this tutorial, we explain the different ways of passing attributes/parameters from servlet to JSP, along with several examples specific for passing data types like: objects, arrays, lists and maps. 1....