rewrite-impl-servlet 1.0.5.Final

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<ISubstitute,ISubstitute.SubstituteParameter,String>, ISubstitute

public class Substitute
extends HttpOperation
implements ISubstitute

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.setOutboundURL(String)

Author:
Lincoln Baxter, III

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ocpsoft.rewrite.servlet.config.ISubstitute
ISubstitute.ISubstituteParameter, ISubstitute.SubstituteParameter
 
Method Summary
 ParameterizedPattern getTargetExpression()
           
 void performHttp(HttpServletRewrite event, EvaluationContext context)
           
 ISubstitute.SubstituteParameter where(String param)
           
 ISubstitute.SubstituteParameter where(String param, Binding binding)
           
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, toString, wait, wait, wait
 
Methods inherited from interface org.ocpsoft.rewrite.config.OperationBuilder
and
 
Methods inherited from interface org.ocpsoft.rewrite.config.Operation
perform
 

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

where

public ISubstitute.SubstituteParameter where(String param)
Specified by:
where in interface Parameterized<ISubstitute,ISubstitute.SubstituteParameter,String>

where

public ISubstitute.SubstituteParameter where(String param,
                                             Binding binding)
Specified by:
where in interface Parameterized<ISubstitute,ISubstitute.SubstituteParameter,String>

getTargetExpression

public ParameterizedPattern getTargetExpression()
Specified by:
getTargetExpression in interface ISubstitute

rewrite-impl-servlet 1.0.5.Final

Copyright © 2012 OCPsoft. All Rights Reserved.