Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.directwebremoting.servlet
Class DwrServlet

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              org.directwebremoting.servlet.DwrServlet

All Implemented Interfaces:
  java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

Direct Known Subclasses:
  DwrGuiceServlet, DWRServlet

    public class DwrServlet

extends javax.servlet.http.HttpServlet

This is the main servlet that handles all the requests to DWR.

It is on the large side because it can't use technologies like JSPs etc since it all needs to be deployed in a single jar file, and while it might be possible to integrate Velocity or similar I think simplicity is more important, and there are only 2 real pages both script heavy in this servlet anyway.

There are 5 things to do, in the order that you come across them:

- The index test page that points at the classes
- The class test page that lets you execute methods
- The interface javascript that uses the engine to send requests
- The engine javascript to form the iframe request and process replies
- The exec 'page' that executes the method and returns data to the iframe

Author:
  Joe Walker [joe at getahead dot ltd dot uk]
See Also:
  Serialized Form

Field Summary
`static Logger` | `log` The log stream

Constructor Summary
`DwrServlet()`

Method Summary
`void` | `destroy()`
`Container` | `getContainer()` Accessor for the DWR IoC container.
`void` | `init(javax.servlet.ServletConfig servletConfig)`
`void` | `shutdown()` Kill all comet polls.

Methods inherited from class javax.servlet.http.HttpServlet
`service`

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

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

Field Detail

### log

    public static final Logger log

  The log stream

Constructor Detail

### DwrServlet

    public DwrServlet()

Method Detail

### init

    public void init(javax.servlet.ServletConfig servletConfig)
              throws javax.servlet.ServletException

  Specified by:
    `init` in interface `javax.servlet.Servlet`
  Overrides:
    `init` in class `javax.servlet.GenericServlet`
  Throws:
    `javax.servlet.ServletException`

### destroy

    public void destroy()

  Specified by:
    `destroy` in interface `javax.servlet.Servlet`
  Overrides:
    `destroy` in class `javax.servlet.GenericServlet`

### shutdown

    public void shutdown()

  Kill all comet polls.

  Technically a servlet engine ought to call this only when all the threads are already removed, however at least Tomcat doesn't do this properly (it waits for a while and then calls destroy anyway).

  It would be good if we could get `destroy()` to call this method however destroy() is only called once all threads are done so it's too late.

### getContainer

    public Container getContainer()

  Accessor for the DWR IoC container.

  Returns:
    DWR's IoC container

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Copyright ¬ 2005
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD