My idea is :if the session is null ,I route to the index.jsp,else route to
the resources. but when the session is null I can not route to
http://192.168.0.154:8181/uiserver/index.jsp.
<route id="camel-http-proxy-manager">
<from
uri="jetty://http://192.168.0.154:8181/mymanager/?matchOnUriPrefix=true"/>
<process ref="myCode"/>
<to
uri="http://192.168.0.156:8181/mymanager/?bridgeEndpoint=true&throwExceptionOnFailure=false"
/>
<to uri="log:MyLogger?level=INFO&showAll=true" />
<choice>
<when>
<simple>${header.sessionId} == '0'</simple>
<setHeader headerName="CamelHttpUrl">
<constant>"http://192.168.0.154:8181/uiserver/index.jsp"</constant>
</setHeader>
<to
uri="ahc://http://192.168.0.154:8181/uiserver/index.jsp" />
</when>
<otherwise>
<to
uri="http://192.168.0.156:8181/mymanager/?bridgeEndpoint=true&throwExceptionOnFailure=false"
/>
<process ref="myCode"/>
<to uri="log:MyLogger?level=INFO&showAll=true" />
</otherwise>
</choice>
</route>
<bean id="myCode" class="org.apache.servicemix.examples.camel.MyTransform">
public void process(Exchange exchange) throws Exception {
String sessionId =
exchange.getIn(HttpMessage.class).getRequest().getRequestedSessionId();
String contextPath =
exchange.getIn(HttpMessage.class).getRequest().getContextPath();
if (null==sessionId)
{
exchange.getIn().setHeader("sessionId", "0");
exchange.getIn().setHeader("path", contextPath);
}
else
{
exchange.getIn().setHeader("sessionId", sessionId);;
}
}
--
View this message in context:
http://camel.465427.n5.nabble.com/can-camel-used-for-Single-Sign-On-tp5744926.html
Sent from the Camel Development mailing list archive at Nabble.com.