camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raja <r...@meru.co.in>
Subject Re: Servlet Session Handling
Date Thu, 18 May 2017 06:29:37 GMT
In the previous post I told about a Problem getting HttpSession after
JDBCComponent.
A little hack solve the Issue but I don't know its right way or not.

The HttpRequest is kept in one of the header named
"CamelHttpServletRequest".So after the JDBCComponent I try to get the
HttpSession from the Header.

Modified Code:
<route>
        <from uri="servlet:login?httpMethodRestrict=POST"/>
        <to uri="bean:sessionProcessor"/>       
        <setBody>JDBC_QUERY</setBody>
        <to uri="jdbc:ds"/>
        <to uri="bean:sessionProcessor1"/>                       
   </route>

sessionProcessor:
 HttpSession
session=exchange.getIn(HttpMessage.class).getRequest().getSession();

sessionProcessor1:
HttpServletRequest
req=(HttpServletRequest)exchange.getIn().getHeader("CamelHttpServletRequest");
HttpSession session=req.getSession();




--
View this message in context: http://camel.465427.n5.nabble.com/Servlet-Session-Handling-tp5799692p5799770.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message