rewrite-config-servlet 2.0.0.Alpha6

org.ocpsoft.rewrite.servlet.config
Class Substitute

java.lang.Object
  extended by org.ocpsoft.rewrite.config.DefaultOperationBuilder
      extended by org.ocpsoft.rewrite.servlet.config.HttpOperation
          extended by org.ocpsoft.rewrite.servlet.config.Substitute
All Implemented Interfaces:
ConfigurationElement, Operation, OperationBuilder, Parameterized

public class Substitute
extends HttpOperation
implements Parameterized

Responsible for substituting inbound/outbound URLs with a replacement. For InboundRewrite events, this Operation calls InboundServletRewrite.forward(String), and for OutboundRewrite events, this method calls HttpOutboundServletRewrite#setOutboundAddress(String)

Author:
Lincoln Baxter, III

Nested Class Summary
 
Nested classes/interfaces inherited from class org.ocpsoft.rewrite.config.DefaultOperationBuilder
DefaultOperationBuilder.NoOp
 
Method Summary
 Set<String> getRequiredParameterNames()
           
 ParameterizedPatternParser getTargetExpression()
           
 void performHttp(HttpServletRewrite event, EvaluationContext context)
           
 void setParameterStore(ParameterStore store)
           
 String toString()
           
static Substitute with(String location)
          Substitute the current URL with the given location.
 
Methods inherited from class org.ocpsoft.rewrite.servlet.config.HttpOperation
perform
 
Methods inherited from class org.ocpsoft.rewrite.config.DefaultOperationBuilder
and, create, wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

with

public static Substitute with(String location)
Substitute the current URL with the given location.

The given location may be parameterized using the following format:

/example/{param}
/example/{value}/sub/{value2}
... and so on

Parameters may be bound. By default, matching parameter values are extracted from bindings in the EvaluationContext.

See also #where(String)


performHttp

public void performHttp(HttpServletRewrite event,
                        EvaluationContext context)
Specified by:
performHttp in class HttpOperation

getTargetExpression

public ParameterizedPatternParser getTargetExpression()

getRequiredParameterNames

public Set<String> getRequiredParameterNames()
Specified by:
getRequiredParameterNames in interface Parameterized

setParameterStore

public void setParameterStore(ParameterStore store)
Specified by:
setParameterStore in interface Parameterized

toString

public String toString()
Overrides:
toString in class Object

rewrite-config-servlet 2.0.0.Alpha6

Copyright © 2013 OCPsoft. All Rights Reserved.