org.directwebremoting.servlet
Class UrlProcessor

java.lang.Object
  extended by org.directwebremoting.servlet.UrlProcessor
All Implemented Interfaces:
Handler, InitializingBean

public class UrlProcessor
extends java.lang.Object
implements Handler, InitializingBean

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:

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
UrlProcessor()
           
 
Method Summary
 void afterContainerSetup(Container container)
          This method allows the bean instance to perform initialization only possible when all bean properties have been set
 java.lang.String getContextPath()
          The contextPath cached from the last HTTP servlet request
 void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handle a URL request that has been mapped to this Handler
 void setIndexHandlerUrl(java.lang.String indexHandlerUrl)
          The URL for the IndexHandler
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UrlProcessor

public UrlProcessor()
Method Detail

afterContainerSetup

public void afterContainerSetup(Container container)
Description copied from interface: InitializingBean

This method allows the bean instance to perform initialization only possible when all bean properties have been set

Specified by:
afterContainerSetup in interface InitializingBean
Parameters:
container - The container that is doing the initialization

handle

public void handle(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws java.io.IOException
Description copied from interface: Handler
Handle a URL request that has been mapped to this Handler

Specified by:
handle in interface Handler
Parameters:
request - The HTTP request data
response - Where we write the HTTP response data
Throws:
java.io.IOException - If the write process fails

getContextPath

public java.lang.String getContextPath()
The contextPath cached from the last HTTP servlet request

Returns:
the contextPath

setIndexHandlerUrl

public void setIndexHandlerUrl(java.lang.String indexHandlerUrl)
The URL for the IndexHandler

Parameters:
indexHandlerUrl - the indexHandlerUrl to set

Copyright 2008