org.eclipse.jetty.rewrite.handler
类 RewriteRegexRule

java.lang.Object
  继承者 org.eclipse.jetty.rewrite.handler.Rule
      继承者 org.eclipse.jetty.rewrite.handler.RegexRule
          继承者 org.eclipse.jetty.rewrite.handler.RewriteRegexRule
所有已实现的接口:
Rule.ApplyURI

public class RewriteRegexRule
extends RegexRule
implements Rule.ApplyURI

Rewrite the URI by matching with a regular expression. The replacement string may use $n" to replace the nth capture group. If the replacement string contains ? character, then it is split into a path and query string component. The replacement query string may also contain $Q, which is replaced with the original query string. The returned target contains only the path.


嵌套类摘要
 
从类 org.eclipse.jetty.rewrite.handler.Rule 继承的嵌套类/接口
Rule.ApplyURI
 
字段摘要
 
从类 org.eclipse.jetty.rewrite.handler.RegexRule 继承的字段
_regex
 
从类 org.eclipse.jetty.rewrite.handler.Rule 继承的字段
_handling, _terminating
 
构造方法摘要
RewriteRegexRule()
           
 
方法摘要
 String apply(String target, HttpServletRequest request, HttpServletResponse response, Matcher matcher)
          Apply this rule to the request/response pair.
 void applyURI(Request request, String oldTarget, String newTarget)
           
 void setReplacement(String replacement)
          Whenever a match is found, it replaces with this value.
 String toString()
          Returns the replacement string.
 
从类 org.eclipse.jetty.rewrite.handler.RegexRule 继承的方法
getRegex, matchAndApply, setRegex
 
从类 org.eclipse.jetty.rewrite.handler.Rule 继承的方法
isHandling, isTerminating, setHandling, setTerminating
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

RewriteRegexRule

public RewriteRegexRule()
方法详细信息

setReplacement

public void setReplacement(String replacement)
Whenever a match is found, it replaces with this value.

参数:
replacement - the replacement string.

apply

public String apply(String target,
                    HttpServletRequest request,
                    HttpServletResponse response,
                    Matcher matcher)
             throws IOException
从类 RegexRule 复制的描述
Apply this rule to the request/response pair. Called by RegexRule.matchAndApply(String, HttpServletRequest, HttpServletResponse) if the regex matches.

指定者:
RegexRule 中的 apply
参数:
target - field to attempt match
request - request object
response - response object
matcher - The Regex matcher that matched the request (with capture groups available for replacement).
返回:
The target (possible updated).
抛出:
IOException - exceptions dealing with operating on request or response objects

applyURI

public void applyURI(Request request,
                     String oldTarget,
                     String newTarget)
              throws IOException
指定者:
接口 Rule.ApplyURI 中的 applyURI
抛出:
IOException

toString

public String toString()
Returns the replacement string.

覆盖:
RegexRule 中的 toString


Copyright © 2013. All Rights Reserved.