examples.servlets
Class HelloWorldServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--examples.servlets.HelloWorldServlet
All Implemented Interfaces:

java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class HelloWorldServlet
extends javax.servlet.http.HttpServlet

 

 

Overview

The HelloWorldServlet demonstrates creating html output in a servlet class.

Here is the build.xml file.

To pull it up, go to:

www.setgetweb.com:7001/examplesWebApp/HelloWorldServlet

 

Build the Example

  1. Open a new command shell.

  2. Set up this development shell as described in Setting up Your Environment for Building and Running the Examples.

  3. Move to the sample directory:
     prompt> cd $SAMPLES_HOME/server/examples/src/examples/servlets

  4. Build the servlet using ant:
      prompt> ant HelloWorldServlet

  5. Start WebLogic Server with the examples configuration.

 

Configure the Server

Make sure that the examplesWebApp is deployed on your server.

 

Run the Example

Use a web browser to load the following URL:

http://www.setgetweb.com:7001/examplesWebApp/HelloWorldServlet

  For more information on servlets see Programming WebLogic HTTP Servlets.

Copyright (c) 1999-2003 by BEA Systems, Inc. All Rights Reserved.

See Also:

Serialized Form

 

  Constructor Summary

HelloWorldServlet()
 

 

Method Summary

 void javax.servlet.http.HttpServletResponse)">service (javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          A very simple implementation of the service method, which outputs the contents of a static html page
 

Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 GenericServlet>

Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

 

Constructor Detail

HelloWorldServlet

public HelloWorldServlet()

 

Method Detail

service

public void service(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse res)
             throws java.io.IOException

A very simple implementation of the service method, which outputs the contents of a static html page

Overrides:

service in class javax.servlet.http.HttpServlet

java.io.IOException