org.vladnput
Interface RequestCanonicalizer


public interface RequestCanonicalizer

This interface can be implemented to customize the way that the request URL and request parameters are matched against the Vlad file. For example, if an application has an environment-specific prefix on all URLs that needs to be stripped so that a single Vlad file can be used for all environments, the getPath() method can be used to strip that prefix. As an another example, if parameter names are not case sensitive, then the canonicalizeParam() method can return a lower case version of the parameter name and all parameters in the Vlad file can be written in lower case to match.

Author:
Patrick Higgins

Method Summary
 java.lang.String canonicalizeParamName(java.lang.String param)
          Returns the canonical form of a parameter name.
 java.lang.String getPath(javax.servlet.http.HttpServletRequest request)
          Returns the URL to match against the Vlad file from the given request.
 

Method Detail

getPath

java.lang.String getPath(javax.servlet.http.HttpServletRequest request)
Returns the URL to match against the Vlad file from the given request.

Parameters:
request - The request URL to canonicalize
Returns:
Canonical URL

canonicalizeParamName

java.lang.String canonicalizeParamName(java.lang.String param)
Returns the canonical form of a parameter name. For example, this could be used to implement case-insensitivity by returning a lower-case or upper-case name.

Parameters:
param - The parameter name to canonicalize
Returns:
Canonical parameter name


Copyright © 2009 Patrick Higgins. All Rights Reserved.