1. Proxies and Flow

if

if allows conditional execution of nested interceptors.

<if test="method == 'POST'" language="SpEL">
         ...
 </if>

Can be used in:

serviceProxy, api, proxy, global, chainDef, for, stompProxy, if, registration, wsStompReassembler, internal, interceptor, chain, bean, transport and soapProxy

Attributes

NameRequiredDefaultDescriptionExamples
test true - Condition to be tested
  • request.isJSON()
  • params['limit'] >= 0
  • statusCode matches '[45]\d\d'

language false SpEL
Language of the 'test' condition
SpEL, groovy, jsonpath, xpath

Child Elements

ElementsDescriptionCardinality
echo 0..*
request 0..*
response 0..*
abort 0..*

Other optional Child Elements

soap2Rest, global, shadowing, soapBody, xmlProtection, accountRegistration, json2Xml, internalRouting, wsaEndpointRewriter, wsdlRewriter, rewriter, http2xml, static, log, webServiceExplorer, jwtSign, openTelemetry, tokenValidator, greaser, APIsJSON, soapStackTraceFilter, requireAuth, webSocket, httpClient, javascript, replace, rest2Soap, webServer, oauth2Resource2, xenAuthentication, testService, logContext, kubernetesValidation, oauth2PermissionChecker, balancer, index, destination, flowInitiator, cors, rateLimiter, analyser, if, ruleMatching, adminApi, counter, xmlContentFilter, reverseProxying, stompClient, statisticsJDBC, accessLog, idempotency, formValidation, clusterNotification, clamav, login, basicAuthentication, setCookies, graphQLProtection, setProperty, validator, statisticsCSV, interceptor, jsonProtection, exchangeStore, statisticsProvider, wsdlPublisher, ntlm, userFeature, call, shutdown, openapiPublisher, transform, groovyTemplate, template, tcp, paddingHeader, for, chain, headerFilter, adminConsole, wadlRewriter, throttle, dispatching, apiDocs, beautifier, urlNormalizer, prometheus, xml2Json, choose, return, jwtAuth, groovy, oauth2authserver, soapOperationExtractor, setHeader, openapiValidator, acmeHttpChallenge, authHead2Body, limit, apiKey, sampleSoapService, regExReplacer, accessControl, cache, methodOverride