WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.servlets
Class SimpleFormServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--examples.servlets.SimpleFormServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class SimpleFormServlet
extends javax.servlet.http.HttpServlet

This example demonstrates using HTML forms in servlets and using htmlKona tables to display the output.

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. Compile the servlet using the following command line:
      $ javac -d %EX_WEBAPP_CLASSES% SimpleFormServlet.java

  4. 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://localhost:7001/examplesWebApp/SimpleFormServlet

There's More...

For more information on servlets, see Programming WebLogic HTTP Servlets.

Author:
Copyright (c) 1996-98 by WebLogic, Inc. All Rights Reserved., Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.

Field Summary
(package private) static int B_CITY
           
(package private) static int B_COMPANY
           
(package private) static int B_COUNTRY
           
(package private) static int B_EMAIL
           
(package private) static int B_MAX
           
(package private) static int B_NAME
           
(package private) static int B_PHONE
           
(package private) static int B_STATE
           
(package private) static int B_STREET
           
(package private) static int B_ZIPCODE
           
(package private) static java.lang.String[] label
           
(package private) static int[] maxlens
           
(package private)  weblogic.html.ServletPage sp
           
(package private)  java.lang.String[] value
           
 
Constructor Summary
SimpleFormServlet()
           
 
Method Summary
(package private) static void ()
           
(package private) static void ()
           
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          The doGet method handles the initial invokation of the servlet.
 void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Responds to the "POST" query from the original form supplied by the goGet() method.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPut, doTrace, getLastModified, service, service
 
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
 

Field Detail

B_CITY

static final int B_CITY

B_COMPANY

static final int B_COMPANY

B_COUNTRY

static final int B_COUNTRY

B_EMAIL

static final int B_EMAIL

B_MAX

static final int B_MAX

B_NAME

static final int B_NAME

B_PHONE

static final int B_PHONE

B_STATE

static final int B_STATE

B_STREET

static final int B_STREET

B_ZIPCODE

static final int B_ZIPCODE

label

static java.lang.String[] label

maxlens

static int[] maxlens

sp

weblogic.html.ServletPage sp

value

java.lang.String[] value
Constructor Detail

SimpleFormServlet

public SimpleFormServlet()
Method Detail

static void ()

static void ()

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse res)
           throws java.io.IOException,
                  javax.servlet.ServletException
The doGet method handles the initial invokation of the servlet. It responds with a form, that will use the "POST" method to submit data.
Overrides:
doGet in class javax.servlet.http.HttpServlet

doPost

public void doPost(javax.servlet.http.HttpServletRequest req,
                   javax.servlet.http.HttpServletResponse res)
            throws java.io.IOException,
                   javax.servlet.ServletException
Responds to the "POST" query from the original form supplied by the goGet() method.
Overrides:
doPost in class javax.servlet.http.HttpServlet

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

Copyright © 2000 BEA Systems, Inc. All Rights Reserved.