Hi Sergey, The below recommendations worked for us. I tried both forward/include, they worked.
The code from RequestDispatcherProvider was also really usefull. Thanks, =Mahesh Kambam. -----Original Message----- From: Sergey Beryozkin [mailto:[email protected]] Sent: Wednesday, June 08, 2011 12:41 PM To: [email protected] Subject: Re: cxf jaxrs reuesthandler and spring 3 MVC DispatcherServlet Integration. Hi On Wed, Jun 8, 2011 at 5:25 PM, Kambam, Mahesh <[email protected]> wrote: > Hi Sergey , > > Thanks for responding so quickly....I am still not clear. > http.request.redirected" (=true) -> does it mean that server will return 302 > to the user-agent ? is there a provision to use forward in that case. > Sorry, I actually meant RequestDispatcher.forward. "http.request.redirected" is misleading to some extent, but it's really a hint to CXF out chain that some other entity is looking after writing some date into output stream. > One more follow up question is how to transfer control from spring MVC to cxf > seamlessly. We use cxf for rest and mvc for ui related issues. Utltimately > cxf is the one that responds. > If you do RequestDispatcher.forward and set that property then the resource which handles the forwarded request will actually be the one that responds. Or perhaps it should be RequestDispatcher.include ? Thanks, Sergey > Thanks, > =Mahesh Kambam. > -----Original Message----- > From: Sergey Beryozkin [mailto:[email protected]] > Sent: Wednesday, June 08, 2011 12:11 PM > To: [email protected] > Subject: Re: cxf jaxrs reuesthandler and spring 3 MVC DispatcherServlet > Integration. > > Hi > > On Wed, Jun 8, 2011 at 4:43 PM, Kambam, Mahesh > <[email protected]> wrote: >> Hi, >> Can somebody help me with the issue of integrating CXF RestFull service with >> Spring DispatcherServlet. >> Here is my issue. >> >> I have a ReST endpoint configured using CXF. I have a requestHandler which >> intercepts the request and do the authentication/authorization. Once this is >> done, I would like to have Spring DispatcherServlet to take the control and >> invoke the appropriate spring controller. >> >> I am having hard time to have CXF Rest features and Spring MVC work >> together.....any solutions/references/material would be really appreciated. >> > > Try injecting ServletContext into RequestHandler, > > @Context ServletContext sc; > > and then after the authentication/authorization is done, redirect to > Spring DispatcherServlet, by getting > RequestDispatcher from ServletContext. Set an > "http.request.redirected" (=true) property on the current message > before doing the redirection. Let me know if it helps > > Cheers, Sergey > > >> Thanks, >> =Mahesh Kambam. >> > > > > -- > Sergey Beryozkin > > Application Integration Division of Talend > http://sberyozkin.blogspot.com >
