org.eclipse.jetty.rewrite.handler
类 RuleContainer

java.lang.Object
  继承者 org.eclipse.jetty.rewrite.handler.Rule
      继承者 org.eclipse.jetty.rewrite.handler.RuleContainer
直接已知子类:
VirtualHostRuleContainer

public class RuleContainer
extends Rule

Base container to group rules. Can be extended so that the contained rules will only be applied under certain conditions


嵌套类摘要
 
从类 org.eclipse.jetty.rewrite.handler.Rule 继承的嵌套类/接口
Rule.ApplyURI
 
字段摘要
protected  LegacyRule _legacy
           
protected  String _originalPathAttribute
           
protected  boolean _rewritePathInfo
           
protected  boolean _rewriteRequestURI
           
protected  Rule[] _rules
           
 
从类 org.eclipse.jetty.rewrite.handler.Rule 继承的字段
_handling, _terminating
 
构造方法摘要
RuleContainer()
           
 
方法摘要
 void addRule(Rule rule)
          Add a Rule
protected  String apply(String target, HttpServletRequest request, HttpServletResponse response)
          Process the contained rules (called by matchAndApply)
 LegacyRule getLegacyRule()
          已过时。 
 String getOriginalPathAttribute()
           
 Rule[] getRules()
          Returns the list of rules.
 boolean isRewritePathInfo()
           
 boolean isRewriteRequestURI()
           
 String matchAndApply(String target, HttpServletRequest request, HttpServletResponse response)
          Process the contained rules
 void setLegacyRule(LegacyRule legacyRule)
          已过时。 
 void setOriginalPathAttribute(String originalPathAttribte)
           
 void setRewritePathInfo(boolean rewritePathInfo)
           
 void setRewriteRequestURI(boolean rewriteRequestURI)
           
 void setRules(Rule[] rules)
          Assigns the rules to process.
 
从类 org.eclipse.jetty.rewrite.handler.Rule 继承的方法
isHandling, isTerminating, setHandling, setTerminating, toString
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

_rules

protected Rule[] _rules

_originalPathAttribute

protected String _originalPathAttribute

_rewriteRequestURI

protected boolean _rewriteRequestURI

_rewritePathInfo

protected boolean _rewritePathInfo

_legacy

protected LegacyRule _legacy
构造方法详细信息

RuleContainer

public RuleContainer()
方法详细信息

getLegacyRule

@Deprecated
public LegacyRule getLegacyRule()
已过时。 


setLegacyRule

@Deprecated
public void setLegacyRule(LegacyRule legacyRule)
已过时。 

To enable configuration from jetty.xml on rewriteRequestURI, rewritePathInfo and originalPathAttribute

参数:
legacyRule - old style rewrite rule

getRules

public Rule[] getRules()
Returns the list of rules.

返回:
an array of Rule.

setRules

public void setRules(Rule[] rules)
Assigns the rules to process.

参数:
rules - an array of Rule.

addRule

public void addRule(Rule rule)
Add a Rule

参数:
rule - The rule to add to the end of the rules array

isRewriteRequestURI

public boolean isRewriteRequestURI()
返回:
the rewriteRequestURI If true, this handler will rewrite the value returned by HttpServletRequest.getRequestURI().

setRewriteRequestURI

public void setRewriteRequestURI(boolean rewriteRequestURI)
参数:
rewriteRequestURI - true if this handler will rewrite the value returned by HttpServletRequest.getRequestURI().

isRewritePathInfo

public boolean isRewritePathInfo()
返回:
true if this handler will rewrite the value returned by HttpServletRequest.getPathInfo().

setRewritePathInfo

public void setRewritePathInfo(boolean rewritePathInfo)
参数:
rewritePathInfo - true if this handler will rewrite the value returned by HttpServletRequest.getPathInfo().

getOriginalPathAttribute

public String getOriginalPathAttribute()
返回:
the originalPathAttribte. If non null, this string will be used as the attribute name to store the original request path.

setOriginalPathAttribute

public void setOriginalPathAttribute(String originalPathAttribte)
参数:
originalPathAttribte - If non null, this string will be used as the attribute name to store the original request path.

matchAndApply

public String matchAndApply(String target,
                            HttpServletRequest request,
                            HttpServletResponse response)
                     throws IOException
Process the contained rules

指定者:
Rule 中的 matchAndApply
参数:
target - target field to pass on to the contained rules
request - request object to pass on to the contained rules
response - response object to pass on to the contained rules
返回:
The new target if the rule has matched, else null
抛出:
IOException - TODO

apply

protected String apply(String target,
                       HttpServletRequest request,
                       HttpServletResponse response)
                throws IOException
Process the contained rules (called by matchAndApply)

参数:
target - target field to pass on to the contained rules
request - request object to pass on to the contained rules
response - response object to pass on to the contained rules
抛出:
IOException


Copyright © 2013. All Rights Reserved.