You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jpcook01 <jo...@erars.plus.com> on 2012/07/09 14:22:09 UTC
Spring MVC with Apache CXF Request Handler
Hello,
I already have a nice custom CXF request handler filter which I would like
to know if it is possible to plug into a Spring MVC web application which
has resources annotated like so:
@RequestMapping(value="/version.json",
method = RequestMethod.GET,
produces="application/json")
So my question is really is it possible to plugin the:
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
and the:
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
Into the same app so then I can make use of my cxf request handler filter
like so:
<jaxrs:server id="jaxrs-myService" address="/">
<jaxrs:serviceBeans>
<bean class="bbc.forge.dsp.jaxrs.ThingApi">
<constructor-arg ref="responseHandler"/>
</bean>
</jaxrs:serviceBeans>
<jaxrs:providers>
<ref bean="whitelistFilter"/>
</jaxrs:providers>
</jaxrs:server>
Ideally I would only use one framework but for now that isn't possible.
Maybe it isn't possible?
Thanks
Jon
--
View this message in context: http://cxf.547215.n5.nabble.com/Spring-MVC-with-Apache-CXF-Request-Handler-tp5710746.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Spring MVC with Apache CXF Request Handler
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi All
On 09/07/12 14:51, Glen Mazza wrote:
> Hopefully you can get an authoritative answer from someone here, but you
> might wish to check in the Spring MVC forum whether there's a way to map
> certain incoming requests (based on a predefined set of URLs) already
> picked up by DispatcherServlet to another servlet instead (you don't
> even have to mention CXFServlet, it's a generic question.) I suspect
> this issue has come up before and they may have ideas for you.
>
One thing I know is that it is possible to configure CXFServlet to
redirect to other servlets.
Would it be worth experimenting with CXFServlet redirecting all the
requests to Spring MVC servlet except for the ones that have to be
handled directly by CXFServlet ?
Jon, what do you think ?
Some info about the auto-redirection is available here:
http://cxf.apache.org/docs/servlet-transport.html
I can provide more feedback if needed.
As a side note, we need to have a look at the closer integration with
Spring MVC, a number of users have asked about CXF & Spring MVC, so it's
worth exploring it further
Thanks, Sergey
> Glen
>
> On 07/09/2012 08:22 AM, jpcook01 wrote:
>> Hello,
>>
>> I already have a nice custom CXF request handler filter which I would
>> like
>> to know if it is possible to plug into a Spring MVC web application which
>> has resources annotated like so:
>>
>> @RequestMapping(value="/version.json",
>> method = RequestMethod.GET,
>> produces="application/json")
>>
>> So my question is really is it possible to plugin the:
>>
>> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
>>
>>
>> and the:
>> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
>>
>>
>> Into the same app so then I can make use of my cxf request handler filter
>> like so:
>>
>> <jaxrs:server id="jaxrs-myService" address="/">
>> <jaxrs:serviceBeans>
>> <bean class="bbc.forge.dsp.jaxrs.ThingApi">
>> <constructor-arg ref="responseHandler"/>
>> </bean>
>> </jaxrs:serviceBeans>
>> <jaxrs:providers>
>> <ref bean="whitelistFilter"/>
>> </jaxrs:providers>
>> </jaxrs:server>
>>
>> Ideally I would only use one framework but for now that isn't possible.
>> Maybe it isn't possible?
>>
>> Thanks
>> Jon
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/Spring-MVC-with-Apache-CXF-Request-Handler-tp5710746.html
>>
>> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com
Re: Spring MVC with Apache CXF Request Handler
Posted by Glen Mazza <gm...@talend.com>.
Hopefully you can get an authoritative answer from someone here, but you
might wish to check in the Spring MVC forum whether there's a way to map
certain incoming requests (based on a predefined set of URLs) already
picked up by DispatcherServlet to another servlet instead (you don't
even have to mention CXFServlet, it's a generic question.) I suspect
this issue has come up before and they may have ideas for you.
Glen
On 07/09/2012 08:22 AM, jpcook01 wrote:
> Hello,
>
> I already have a nice custom CXF request handler filter which I would like
> to know if it is possible to plug into a Spring MVC web application which
> has resources annotated like so:
>
> @RequestMapping(value="/version.json",
> method = RequestMethod.GET,
> produces="application/json")
>
> So my question is really is it possible to plugin the:
>
> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
>
> and the:
> <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
>
> Into the same app so then I can make use of my cxf request handler filter
> like so:
>
> <jaxrs:server id="jaxrs-myService" address="/">
> <jaxrs:serviceBeans>
> <bean class="bbc.forge.dsp.jaxrs.ThingApi">
> <constructor-arg ref="responseHandler"/>
> </bean>
> </jaxrs:serviceBeans>
> <jaxrs:providers>
> <ref bean="whitelistFilter"/>
> </jaxrs:providers>
> </jaxrs:server>
>
> Ideally I would only use one framework but for now that isn't possible.
> Maybe it isn't possible?
>
> Thanks
> Jon
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Spring-MVC-with-Apache-CXF-Request-Handler-tp5710746.html
> Sent from the cxf-user mailing list archive at Nabble.com.
--
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza