org.directwebremoting.impl
Class DefaultPageNormalizer

java.lang.Object
  extended by org.directwebremoting.impl.DefaultPageNormalizer
All Implemented Interfaces:
PageNormalizer

public class DefaultPageNormalizer
extends java.lang.Object
implements PageNormalizer

The default implementation of PageNormalizer attempts to read from WEB-INF/web.xml to find a welcome-files element, and uses a default of removing "index.html" and "index.jsp" if this procedure fails.

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

Constructor Summary
DefaultPageNormalizer()
           
 
Method Summary
 java.lang.String normalizePage(java.lang.String unnormalized)
          Take an un-normalized URL and turn it into the canonical form for that URL.
 void setNormalizeIncludesQueryString(boolean normalizeIncludesQueryString)
          Does the page normalizer include query strings in it's definition of pages?
 void setNormalizeIncludesSessionID(boolean normalizeIncludesSessionID)
          Does the page normalizer include the session id if it is being appended to the url in it's definition of pages?
 void setServletContext(javax.servlet.ServletContext servletContext)
           
 void setWelcomeFileList(java.util.List<java.lang.String> welcomeFiles)
          Accessor for the list of components to strip to normalize a filename
 void setWelcomeFiles(java.lang.String welcomeFileNames)
          Accessor for the list of components to strip to normalize a filename
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPageNormalizer

public DefaultPageNormalizer()
Method Detail

normalizePage

public java.lang.String normalizePage(java.lang.String unnormalized)
Description copied from interface: PageNormalizer
Take an un-normalized URL and turn it into the canonical form for that URL. In general this will work by stripping off extra components like index.html rather than adding them in.

Specified by:
normalizePage in interface PageNormalizer
Parameters:
unnormalized - The raw string from the browser
Returns:
A canonical form that DWR uses to compare pages for equivalence.

setWelcomeFileList

public void setWelcomeFileList(java.util.List<java.lang.String> welcomeFiles)
Accessor for the list of components to strip to normalize a filename

Parameters:
welcomeFiles - the welcomeFiles to set

setWelcomeFiles

public void setWelcomeFiles(java.lang.String welcomeFileNames)
Accessor for the list of components to strip to normalize a filename

Parameters:
welcomeFileNames - the welcomeFiles to set as a comma or newline separated list.

setNormalizeIncludesQueryString

public void setNormalizeIncludesQueryString(boolean normalizeIncludesQueryString)
Does the page normalizer include query strings in it's definition of pages?

Parameters:
normalizeIncludesQueryString - The new value

setNormalizeIncludesSessionID

public void setNormalizeIncludesSessionID(boolean normalizeIncludesSessionID)
Does the page normalizer include the session id if it is being appended to the url in it's definition of pages?

Parameters:
normalizeIncludesSessionID - The new value

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Parameters:
servletContext - the servletContext to set

Copyright 2008