All Examples  This Package

Class examples.servlets.PageEvent

java.lang.Object
   |
   +----javax.servlet.GenericServlet
           |
           +----javax.servlet.http.HttpServlet
                   |
                   +----examples.servlets.PageEvent

public class PageEvent
extends HttpServlet
This example demonstrates sending an event to the WebLogic Server containing all of the available header information of a request to the servlet. It uses an EventMessage to send information to WebLogic about the hits on this page; whomever has registered an interest in the event "HTTPWATCH" receives notification of the event, along with the collected information.

To run this example, compile it and register the servlet with the initArg "imagefile" set to a local image file on your WebLogic Server host. Then start WebLogic. At a command-line prompt, start the WebLogic utility, eventsnoop, and register an interest in the page-related events with the following command:

 $ java utils.eventsnoop t3://localhost:7001 HTTPWATCH
where t3://localhost:7001 corresponds to the host and port of your running WebLogic Server. Then access the page. You'll see the resulting events in the command window.

WebLogic also has a builtin service that allows you to register an interest in HTTP events and have them logged in common log format to an HTTP log. For more info, read the WebLogic Administrators Guide document, Setting up WebLogic as an HTTP server.


Constructor Index

 o PageEvent()

Method Index

 o getServletInfo()
 o service(HttpServletRequest, HttpServletResponse)
Implements the service method.

Constructors

 o PageEvent
 public PageEvent()

Methods

 o service
 public void service(HttpServletRequest req,
                     HttpServletResponse res) throws IOException
Implements the service method.

Overrides:
service in class HttpServlet
 o getServletInfo
 public String getServletInfo()
Overrides:
getServletInfo in class GenericServlet

All Examples  This Package