WebLogic Server 6.0.0 Code Examples, BEA Systems, Inc.

Package examples.webapp.cookie

This example demonstrates the Web Application Archive (WAR) format and how a Web Application is deployed and accessed from a browser client.

See:
          Description

Cookie Example File Summary
web.xml Web Application deployment descriptor. The descriptor configures a servlet, a welcome file (.html), and an error page (.jsp).
error.jsp Error page for the cookie Web Application.
hello.html Welcome page for the cookie Web Application.
cookie.jpg Image file displayed in by the CookieCounter servlet
CookieCounter.java The CookieCounter servlet from the examples.servlets package is compiled and packaged into the WAR file created in this example.
 

Package examples.webapp.cookie Description

This example demonstrates the Web Application Archive (WAR) format and how a Web Application is deployed and accessed from a browser client. This example demonstrates how servlets and served files (.html, .jsp, and image files) must be packaged when deployed in a WAR file.

Perform the following steps in order to build and run the example:

  1. Build the example
  2. Run the example

Build the Example

For your convenience, a build script is included in the samples/examples/webapp/cookie directory that compiles the servlet, packages the Web Application into a WAR file, and places the WAR file into the config/examples/applications directory where it is automatically deployed. The build script performs the following steps (you should view the build script to determine the exact commands used):
  1. Create a staging directory named build for the Web Application. This includes a WEB-INF subdirectory which is used to store the Web Application deployment descriptor, web.xml, and the classes required by the Web Application.
  2. Copy the deployment descriptor and served files into the appropriate locations in the staging directory.
  3. Compile the CookieCounter servlet from the examples.servlets package into the WEB-INF/classes subdirectory of the staging directory.
  4. Create a WAR file using the jar command and save the WAR file into the config/examples/applications directory.

Run the Example

  1. Start WebLogic Server with the examples configuration.

  2. Load the cookie Web Application into a browser using a URL such as:
      http://hostname:port/cookie
    where:
    hostname
    Host name of the WebLogic Server
    port
    Port where the WebLogic Server is listening for connections
  3. Follow the "Click here" link.

There's More...


Documentation is available at
http://e-docs.bea.com/wls/docs60/

Copyright © 2000 BEA Systems, Inc. All rights reserved.