Go to new doc!

+49 228 5552576-0


info@predic8.com

rewriter

Description

Rewrites or redirects the path of incoming requests based on a mapping.

Can be used in

spring:beans, api, bean, if, interceptor, internalProxy, proxy, registration, request, response, serviceProxy, soapProxy, stompProxy, swaggerProxy, transport and wsStompReassembler

Syntax

				<rewriter>
					<map from="..." to="..." do="..." >*
				</rewriter>
			
Listing 1: rewriter Syntax

Sample

The first mapping in the example below shows a simple mapping from the path /home to /index.
In the second mapping a regexp group captures everything after /bank/. The $1 in the rewritten URI will be substituted with the content of the captured group.
In the third mapping, a group captures everything after /search/ and redirects the user to some example search portal searching for the content of the group.

				<serviceProxy port="80">
					<rewriter>
						<map from="^/home" to="/index" />
						<map from="^/bank/(.*)" to="/axis2/$1" />
						<map from="^/search/(.*)" to="http://www.example.com/search?q=$1" do="redirect" />
					</rewriter>						
				</serviceProxy>
			
Listing 2: rewriter Example

Child Elements

Position Cardinality Description Element
1 1..* Defines a regex and a replacement for the rewriting of the URI. map