Book Image

Learning Modular Java Programming

By : Tejaswini Mandar Jog
Book Image

Learning Modular Java Programming

By: Tejaswini Mandar Jog

Overview of this book

Modular programming means dividing an application into small parts and then developing it. It is an approach taken by developers to build applications and helps them add efficiency in their development process, thus making it more effective. The book starts with the fundamentals of Modular Programming. Then we move on to the actual implementation, where we teach developers how to divide an application into different modules or layers (such as presentation, execution, security, lifecycle, services, and so on) for better management. Once readers are well-versed in these modules and their development, the book shows how to create bindings in order to join these different modules and form a complete application. Next, the readers will learn how to manage these modules through dependency injection. Later, we move on to testing; readers will learn how to test the different modules of an application. The book ends by teaching readers how to maintain different versions of their application and how to modify it. By the end of the book, readers will have a good understanding of modular programming and will be able to use it to build applications with Java.
Table of Contents (15 chapters)

Project deployment


We created the project in Eclipse IDE and tested it there. It may be possible to give our project to others to use, or want to use it on some other machine. The process of installing our application into the server context is called project deployment. This process is server-specific. On successful deployment, we can use a project without eclipse IDE. Here we will discuss the possible ways of deploying our application into a Tomcat7 server.

We can create a web archive file (WAR) and deploy it in Tomcat with one of the two ways described in the following sections.

Copying a WAR file into Tomcat without Tomcat manager

To copy a WAR file of our application, first of all we need to generate the WAR file from eclipse as follows:

  1. Create a new dynamic web project, Ch08_Demo_Deployment.

  2. Add index.jsp in WebContent as follows:

    <%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC"-//W3C//DTD HTML 4.01 Transitional...