org.tuckey.web.filters.urlrewrite
Class NormalRule
java.lang.Object
org.tuckey.web.filters.urlrewrite.RuleBase
org.tuckey.web.filters.urlrewrite.NormalRule
- All Implemented Interfaces:
- Rule, Runnable
public class NormalRule
- extends RuleBase
- implements Rule
Defines a rule that can be run against an incoming request.
20040304 - Thanks to Scott Askew for help with concurrency issue with Perl5Compiler and Perl5Matcher.
- Version:
- $Revision: 36 $ $Date: 2006-09-19 18:32:39 +1200 (Tue, 19 Sep 2006) $
- Author:
- Paul Tuckey
| Methods inherited from class org.tuckey.web.filters.urlrewrite.RuleBase |
addCondition, addRun, addSetAttribute, destroy, getConditions, getErrors, getFrom, getId, getMatchType, getNote, getRuns, getServletContext, getSetAttributes, getTo, isEnabled, isFilter, isFromCaseSensitive, isLast, isMatchTypeWildcard, isNoSubstitution, isToContainsBackReference, isToContainsFunction, isToContainsVariable, isValid, matchesBase, setEnabled, setFrom, setFromCaseSensitive, setId, setMatchType, setName, setNote, setTo, setToLast |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
toType
public short toType
TO_TYPE_REDIRECT
public static final short TO_TYPE_REDIRECT
- See Also:
- Constant Field Values
TO_TYPE_FORWARD
public static final short TO_TYPE_FORWARD
- See Also:
- Constant Field Values
TO_TYPE_PERMANENT_REDIRECT
public static final short TO_TYPE_PERMANENT_REDIRECT
- See Also:
- Constant Field Values
TO_TYPE_TEMPORARY_REDIRECT
public static final short TO_TYPE_TEMPORARY_REDIRECT
- See Also:
- Constant Field Values
TO_TYPE_PRE_INCLUDE
public static final short TO_TYPE_PRE_INCLUDE
- See Also:
- Constant Field Values
TO_TYPE_POST_INCLUDE
public static final short TO_TYPE_POST_INCLUDE
- See Also:
- Constant Field Values
TO_TYPE_PROXY
public static final short TO_TYPE_PROXY
- See Also:
- Constant Field Values
NormalRule
public NormalRule()
- Constructor.
matches
public RewrittenUrl matches(String url,
javax.servlet.http.HttpServletRequest hsRequest,
javax.servlet.http.HttpServletResponse hsResponse,
RuleChain chain)
throws IOException,
javax.servlet.ServletException,
InvocationTargetException
- Will run the rule against the uri and perform action required will return false is not matched
otherwise true.
- Specified by:
matches in interface Rule
- Parameters:
url - hsRequest -
- Returns:
- String of the rewritten url or the same as the url passed in if no match was made
- Throws:
IOException
javax.servlet.ServletException
InvocationTargetException
matches
public RewrittenUrl matches(String url,
javax.servlet.http.HttpServletRequest hsRequest,
javax.servlet.http.HttpServletResponse hsResponse)
throws IOException,
javax.servlet.ServletException,
InvocationTargetException
- Specified by:
matches in interface Rule
- Throws:
IOException
javax.servlet.ServletException
InvocationTargetException
initialise
public boolean initialise(javax.servlet.ServletContext context)
- Will initialise the rule.
- Specified by:
initialise in interface Rule- Overrides:
initialise in class RuleBase
- Returns:
- true on success
setToType
public void setToType(String toTypeStr)
- Redirect or passthrough, passthrough is the default.
- Parameters:
toTypeStr - to type string
getToType
public String getToType()
- Will get to type ie redirect or passthrough.
- Returns:
- String
addError
protected void addError(String s)
- Overrides:
addError in class RuleBase
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName in interface Rule- Overrides:
getDisplayName in class RuleBase
getName
public String getName()
- Specified by:
getName in interface Rule- Overrides:
getName in class RuleBase
getFullDisplayName
public String getFullDisplayName()
- Overrides:
getFullDisplayName in class RuleBase
isEncodeToUrl
public boolean isEncodeToUrl()
setEncodeToUrl
public void setEncodeToUrl(boolean encodeToUrl)
getToContextStr
public String getToContextStr()
setToContextStr
public void setToContextStr(String toContextStr)
getToServletContext
public javax.servlet.ServletContext getToServletContext()
setQueryStringAppend
public void setQueryStringAppend(String value)
Copyright © 2001-2012 Paul Tuckey. All Rights Reserved.