Chapter 9. Using Web Tier

Table of Contents

9.1. Example
9.2. Compilation
9.3. Deploy
9.4. Execution Result

This chapter describes how to deploy servlet, JSP, JSTL, and JSF applications, and how to package and deploy WAR (Web application ARchive) modules.

This section shows sample code for a web application and how to compile and deploy the code.

The following sample servlet displays the message "Hello World!" in a web browser.


The sample file is in the following directory.

JEUS_HOME/samples/getting_started/helloservlet/src/java

The following sample JSP program named 'snoop.jsp' shows information about the request it receives.


The following sample JSP program has the same functionality as snoop.jsp except that it uses JSTP and JSF.


JSP programs are automatically compiled by the servlet engine and don't need to be compiled manually.

The sample code can be built by using jant as in the following.

%JEUS_HOME%/samples/getting_started/helloservlet>jant build

After the sample code has been built successfully, a WAR file named 'hello-servlet.war' will be created in the dist folder.

A packaged WAR application can be deployed by using WebAdmin or console.

Deploying WAR Applications in WebAdmin

In JEUS 7.0, there are two steps for deploying applications, installation and deployment.

This section describes how to deploy WAR applications.

Deploying a WAR Application in the Console

This section describes how to deploy and test a WAR application in the console.

  1. Log in to JEUS as jeusadmin.

    jeusadmin –u administrator –p <password>
  2. Install the application on DAS.

    [DAS]jeus_domain.adminServer>install-application -id helloworld C:/TmaxSoft/JEUS7.0/samples/getting_started/helloservlet/dist/hello-servlet.war
    Successfully installed application[helloworld].
  3. Deploy the application to an MS (Server1).

    [DAS]jeus_domain.adminServer>deploy helloworld -servers server1
    Succeeded to deploy the application : helloworld
  4. Verify that the application has been deployed successfully.

This section describes how to execute the deployed servlets and JSPs.

Executing a Deployed JSP

Deployed JSPs can be executed by:

Executing a Deployed Servlet

To access the 'helloworld' servlet, open a browser window and enter the following URL into the address bar.

http://localhost:8088/helloworld/HelloWorldServlet
ItemDescription
httpHTTP protocol is used to access JEUS.
localhostServer that provides the service is on the local machine.
8088Port number of the HTTP listener created on the MS.
helloworldWeb application context path. This path is set in the <context-path> element of 'jeus-web-dd.xml'. By default, it has the same name as the WAR file.
HelloWorldServletURL pattern defined in the servlet.

The following message will appear if the servlet engine has started normally and the Hello World servlet has been deployed successfully.