Home » Enterprise Java

Enterprise Java

Java Servlet and JSP Example

In this article we will demonstrate a simple Servlet and JSP example using the maven cargo plugin from the command line. We will also cover, albeit briefly, the functioning of both Servlet and JSP constructs within the Servlet Container in terms of how they are used to satisfy a HTTP request. The sample application will greet you with your name, ...

Read More »

Spring REST with JSON Example

RESTful web services using JSON data format address the problems with SOAP web services using XML. REST can output data in different formats like Comma Separated Values (CSV) or Really Simple Syndication (RSS), but the most popular format is JSON. Compared to XML, JSON is not only more human readable but also lightweight. It’s easier for the browser to take ...

Read More »

Spring Boot JDBC Example

Do you want to learn about using Spring Boot with JDBC? Yes? Then you have come to the right place. This example is very straight forward and simple, even a 12 year old can understand. Let’s begin with our Spring Boot JDBC example. 1. Tools Apache Maven Mars Eclipse Spring Boot H2 Database Engine 2. Assumptions This article assumes that ...

Read More »

Apache ActiveMQ File Transfer Example

1. Introduction Apache ActiveMQ (AMQ) is a message broker which transfers messages from sender to receiver. In this example, I will build two simple AMQ applications which will transfer files from one location to another: A producer sends a file via BytesMessage or BlobMessage A consumer receives the BytesMessage or BlobMessage and saves it as a file 2. JMS Message Type JMS defines six ...

Read More »

Apache ActiveMQ Distributed Queue Tutorial

Apache ActiveMQ (AMQ) is an open source messaging server written in Java, which implements JMS 1.1 specifications. In this article, I will demonstrate how to utilize a distributed queue within a group of AMQ brokers. Table Of Contents 1. Introduction 2. Apache ActiveMQ Server Installation 3. Producer Java Application 3.1. MessageProducerApp 3.2. QueueMessageProducer 3.3. Export MessageProducerApp as a Jar 4. ...

Read More »

Java Servlet Container Example

In this article we will demonstrate deploying and running a simple web application via a servlet container. In addition to demonstrating how to run the sample web application using a servlet container will also show how to run the sample web application using maven from the command line. For this article we will make use of Tomcat 8.5.x both for ...

Read More »

Log4j Rotation Example

This article is a tutorial about log rotation in Log4j. In this tutorial, we are going to configure log4j via property files. 1. Introduction Log4J(Java) is widely used logging framework for Java. It continues to grow continuously with recent upgrade of Log4j2. We want to rotate log files to avoid log file accumulation and easily segregate logs under the log ...

Read More »

Spring SOAP with XML Example

Web services are the distributed computing mechanism designed to work with open standards and protocols, thus facilitating interoperability among disparate systems. Simple Object Access Protocol (SOAP) was developed by Microsoft as an improvement over the existing technologies like Distributed Component Object Model (DCOM), Common Object Request Broker Architecture (CORBA) and Java Remote Method Invocation (RMI) that relied on binary and ...

Read More »

Java Servlet File Download and File Upload Example

Hello readers, in this tutorial, we will show you how to set up the File Upload and Download functionality in a Servlet based Java web application. Table Of Contents 1. Introduction 1.1 What is Servlet? 1.2 Servlet File Upload 1.3 Servlet File Download 2. Java Servlet File Download and File Upload Example 2.1 Tools Used 2.2 Project Structure 2.3 Project ...

Read More »

Spring Web Application Example

In this article we will see how to develop a simple web application using Spring framework. This is a very simple example of developing a spring web application; it does not go into the details of performance, security, scaling etc. 1. Introduction Spring Framework is a Java platform that provides comprehensive infrastructure support for developing Java applications. Spring handles the ...

Read More »