public class RewriteRule extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
chain
This flag chains the current rule with the next rule (which itself
can be chained with the following rule, etc.).
|
protected RewriteCond[] |
conditions |
protected boolean |
cookie
This sets a cookie on the client's browser.
|
protected String |
cookieDomain |
protected boolean |
cookieHttpOnly |
protected int |
cookieLifetime |
protected String |
cookieName |
protected String |
cookiePath |
protected ThreadLocal<String> |
cookieResult |
protected boolean |
cookieSecure |
protected Substitution |
cookieSubstitution |
protected String |
cookieValue |
protected boolean |
env
This forces a request attribute named VAR to be set to the value VAL,
where VAL can contain regexp back references $N and %N which will be
expanded.
|
protected ArrayList<String> |
envName |
protected ArrayList<ThreadLocal<String>> |
envResult |
protected ArrayList<Substitution> |
envSubstitution |
protected ArrayList<String> |
envValue |
protected boolean |
forbidden
This forces the current URL to be forbidden, i.e., it immediately sends
back a HTTP response of 403 (FORBIDDEN).
|
protected boolean |
gone
This forces the current URL to be gone, i.e., it immediately sends
back a HTTP response of 410 (GONE).
|
protected boolean |
host
Host.
|
protected boolean |
last
Stop the rewriting process here and don't apply any more rewriting
rules.
|
protected boolean |
next
Re-run the rewriting process (starting again with the first rewriting
rule).
|
protected boolean |
nocase
This makes the Pattern case-insensitive, i.e., there is no difference
between 'A-Z' and 'a-z' when Pattern is matched against the current
URL.
|
protected boolean |
noescape
This flag keeps mod_rewrite from applying the usual URI escaping rules
to the result of a rewrite.
|
protected boolean |
nosubreq
This flag forces the rewriting engine to skip a rewriting rule if the
current request is an internal sub-request.
|
protected ThreadLocal<Pattern> |
pattern |
protected String |
patternString |
protected boolean |
qsappend
This flag forces the rewriting engine to append a query string part in
the substitution string to the existing one instead of replacing it.
|
protected boolean |
redirect
Prefix Substitution with http://thishost[:thisport]/ (which makes the
new URL a URI) to force a external redirection.
|
protected int |
redirectCode |
protected int |
skip
This flag forces the rewriting engine to skip the next num rules in
sequence when the current rule matches.
|
protected Substitution |
substitution |
protected String |
substitutionString |
protected boolean |
type
Force the MIME-type of the target file to be MIME-type.
|
protected String |
typeValue |
Constructor and Description |
---|
RewriteRule() |
Modifier and Type | Method and Description |
---|---|
void |
addCondition(RewriteCond condition) |
void |
addEnvName(String envName) |
void |
addEnvValue(String envValue) |
CharSequence |
evaluate(CharSequence url,
Resolver resolver)
Evaluate the rule based on the context
|
RewriteCond[] |
getConditions() |
String |
getCookieDomain() |
int |
getCookieLifetime() |
String |
getCookieName() |
String |
getCookiePath() |
String |
getCookieResult() |
String |
getCookieValue() |
String |
getEnvName(int i) |
String |
getEnvResult(int i) |
int |
getEnvSize() |
String |
getEnvValue(int i) |
String |
getPatternString() |
int |
getRedirectCode() |
int |
getSkip() |
Substitution |
getSubstitution() |
String |
getSubstitutionString() |
String |
getTypeValue() |
boolean |
isChain() |
boolean |
isCookie() |
boolean |
isCookieHttpOnly() |
boolean |
isCookieSecure() |
boolean |
isEnv() |
boolean |
isForbidden() |
boolean |
isGone() |
boolean |
isHost() |
boolean |
isLast() |
boolean |
isNext() |
boolean |
isNocase() |
boolean |
isNoescape() |
boolean |
isNosubreq() |
boolean |
isQsappend() |
boolean |
isRedirect() |
boolean |
isType() |
void |
parse(Map<String,RewriteMap> maps) |
void |
setChain(boolean chain) |
void |
setConditions(RewriteCond[] conditions) |
void |
setCookie(boolean cookie) |
void |
setCookieDomain(String cookieDomain) |
void |
setCookieHttpOnly(boolean cookieHttpOnly) |
void |
setCookieLifetime(int cookieLifetime) |
void |
setCookieName(String cookieName) |
void |
setCookiePath(String cookiePath) |
void |
setCookieSecure(boolean cookieSecure) |
void |
setCookieValue(String cookieValue) |
void |
setEnv(boolean env) |
void |
setForbidden(boolean forbidden) |
void |
setGone(boolean gone) |
void |
setHost(boolean host) |
void |
setLast(boolean last) |
void |
setNext(boolean next) |
void |
setNocase(boolean nocase) |
void |
setNoescape(boolean noescape) |
void |
setNosubreq(boolean nosubreq) |
void |
setPatternString(String patternString) |
void |
setQsappend(boolean qsappend) |
void |
setRedirect(boolean redirect) |
void |
setRedirectCode(int redirectCode) |
void |
setSkip(int skip) |
void |
setSubstitution(Substitution substitution) |
void |
setSubstitutionString(String substitutionString) |
void |
setType(boolean type) |
void |
setTypeValue(String typeValue) |
String |
toString()
String representation.
|
protected RewriteCond[] conditions
protected ThreadLocal<Pattern> pattern
protected Substitution substitution
protected String patternString
protected String substitutionString
protected boolean chain
protected boolean cookie
protected String cookieName
protected String cookieValue
protected String cookieDomain
protected int cookieLifetime
protected String cookiePath
protected boolean cookieSecure
protected boolean cookieHttpOnly
protected Substitution cookieSubstitution
protected ThreadLocal<String> cookieResult
protected boolean env
protected ArrayList<Substitution> envSubstitution
protected ArrayList<ThreadLocal<String>> envResult
protected boolean forbidden
protected boolean gone
protected boolean host
protected boolean last
protected boolean next
protected boolean nocase
protected boolean noescape
protected boolean nosubreq
protected boolean qsappend
protected boolean redirect
protected int redirectCode
protected int skip
protected boolean type
protected String typeValue
public void parse(Map<String,RewriteMap> maps)
public void addCondition(RewriteCond condition)
public CharSequence evaluate(CharSequence url, Resolver resolver)
public boolean isChain()
public void setChain(boolean chain)
public RewriteCond[] getConditions()
public void setConditions(RewriteCond[] conditions)
public boolean isCookie()
public void setCookie(boolean cookie)
public String getCookieName()
public void setCookieName(String cookieName)
public String getCookieValue()
public void setCookieValue(String cookieValue)
public String getCookieResult()
public boolean isEnv()
public int getEnvSize()
public void setEnv(boolean env)
public String getEnvName(int i)
public void addEnvName(String envName)
public String getEnvValue(int i)
public void addEnvValue(String envValue)
public String getEnvResult(int i)
public boolean isForbidden()
public void setForbidden(boolean forbidden)
public boolean isGone()
public void setGone(boolean gone)
public boolean isLast()
public void setLast(boolean last)
public boolean isNext()
public void setNext(boolean next)
public boolean isNocase()
public void setNocase(boolean nocase)
public boolean isNoescape()
public void setNoescape(boolean noescape)
public boolean isNosubreq()
public void setNosubreq(boolean nosubreq)
public boolean isQsappend()
public void setQsappend(boolean qsappend)
public boolean isRedirect()
public void setRedirect(boolean redirect)
public int getRedirectCode()
public void setRedirectCode(int redirectCode)
public int getSkip()
public void setSkip(int skip)
public Substitution getSubstitution()
public void setSubstitution(Substitution substitution)
public boolean isType()
public void setType(boolean type)
public String getTypeValue()
public void setTypeValue(String typeValue)
public String getPatternString()
public void setPatternString(String patternString)
public String getSubstitutionString()
public void setSubstitutionString(String substitutionString)
public boolean isHost()
public void setHost(boolean host)
public String getCookieDomain()
public void setCookieDomain(String cookieDomain)
public int getCookieLifetime()
public void setCookieLifetime(int cookieLifetime)
public String getCookiePath()
public void setCookiePath(String cookiePath)
public boolean isCookieSecure()
public void setCookieSecure(boolean cookieSecure)
public boolean isCookieHttpOnly()
public void setCookieHttpOnly(boolean cookieHttpOnly)
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.