Top Description Methods
org.apache.catalina.valves.rewrite

public Interface RewriteMap

Known Direct Implementers
org.apache.catalina.valves.rewrite.InternalRewriteMap.LowerCase, org.apache.catalina.valves.rewrite.InternalRewriteMap.UpperCase, org.apache.catalina.valves.rewrite.InternalRewriteMap.Escape, org.apache.catalina.valves.rewrite.InternalRewriteMap.Unescape, org.apache.catalina.valves.rewrite.RandomizedTextRewriteMap
Imports
org.apache.tomcat.util.res.StringManager

Interface for user defined lookup/replacement logic that can be defined in a rewrite.config file by a RewriteMap directive. Such a map can then be used by a RewriteRule defined in the same file.

An example rewrite.config file could look like:

RewriteMap uc example.UpperCaseMap

RewriteRule ^/(.*)$ ${uc:$1}
One parameter can be optionally appended to the RewriteMap directive. This could be used – for example – to specify a name of a file, that contains a lookup table used by the implementation of the map.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

mapped value or null
lookup
(String
used by the actual implementation to generate a mapped value
key
)

Maps a key to a replacement value.

public String

Returns:

value is currently ignored
setParameters
(String
the optional parameter
params
)

Optional parameter that can be defined through the RewriteMap directive in the rewrite.config file.

public default void
setParameters(String...
the optional parameters
params
)

Optional parameters that can be defined through the RewriteMap directive in the rewrite.config file.

Method Detail

lookupback to summary
public String lookup(String key)

Maps a key to a replacement value.
The method is free to return null to indicate, that the default value from the RewriteRule directive should be used.

Parameters
key:String

used by the actual implementation to generate a mapped value

Returns:String

mapped value or null

setParametersback to summary
public String setParameters(String params)

Optional parameter that can be defined through the RewriteMap directive in the rewrite.config file.

Parameters
params:String

the optional parameter

Returns:String

value is currently ignored

setParametersback to summary
public default void setParameters(String... params)

Optional parameters that can be defined through the RewriteMap directive in the rewrite.config file.

This method will be called, if there are more than one parameters defined.

Parameters
params:String[]

the optional parameters