You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Christian Schneider <ch...@die-schneider.net> on 2010/11/30 01:10:38 UTC
Discuss: CXFServlet and spring ApplicationContext
I am currently trying to dig deeper into the http transport.
One part of the code that I really don´t like is the CXFServlet. If I
understand correctly it is being used when you want to have a servlet
transport together with a spring application context.
In the documentation (http://cxf.apache.org/docs/servlet-transport.html)
there are two ways to use it:
You can either use ContextLoaderListener from spring or let it pull up a
new context.
I don´t know if it is only because of the second option but there is
some really ugly code in there to find or pull up an application context
and work directly with it.
So my point is that we should let spring do this. Can´t we just let
spring inject whatever we need?
Best regards
Christian
--
----
http://www.liquid-reality.de
Re: Discuss: CXFServlet and spring ApplicationContext
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Christian
On Tue, Nov 30, 2010 at 12:16 AM, Christian Schneider <
chris@die-schneider.net> wrote:
> One thing I found is the spring DispatcherServlet:
>
> http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/servlet/DispatcherServlet.html
>
> Could we simply use this servlet to route requests to our services and have
> no own servlet at all?
CXFServlet lets us customize the way requests are dealt with. Example, it
can be configured to route the requests to other destinations.
cheers, Sergey
> Spring uses this for their own remoting protocols.
>
> Best regards
>
> Christian
>
>
> Am 30.11.2010 01:10, schrieb Christian Schneider:
>
> I am currently trying to dig deeper into the http transport.
>>
>> One part of the code that I really don´t like is the CXFServlet. If I
>> understand correctly it is being used when you want to have a servlet
>> transport together with a spring application context.
>> In the documentation (http://cxf.apache.org/docs/servlet-transport.html)
>> there are two ways to use it:
>>
>> You can either use ContextLoaderListener from spring or let it pull up a
>> new context.
>>
>> I don´t know if it is only because of the second option but there is some
>> really ugly code in there to find or pull up an application context and work
>> directly with it.
>> So my point is that we should let spring do this. Can´t we just let spring
>> inject whatever we need?
>>
>> Best regards
>>
>> Christian
>>
>>
> --
> ----
> http://www.liquid-reality.de
>
>
Re: Discuss: CXFServlet and spring ApplicationContext
Posted by Daniel Kulp <dk...@apache.org>.
On Monday 29 November 2010 7:16:25 pm Christian Schneider wrote:
> One thing I found is the spring DispatcherServlet:
> http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/we
> b/servlet/DispatcherServlet.html
>
> Could we simply use this servlet to route requests to our services and
> have no own servlet at all? Spring uses this for their own remoting
> protocols.
We COULD, yes. But we would still need to provide a Servlet or similar for
all the people that don't use Spring. Thus, it doesn't change much. :-)
Dan
>
> Best regards
>
> Christian
>
> Am 30.11.2010 01:10, schrieb Christian Schneider:
> > I am currently trying to dig deeper into the http transport.
> >
> > One part of the code that I really don´t like is the CXFServlet. If I
> > understand correctly it is being used when you want to have a servlet
> > transport together with a spring application context.
> > In the documentation
> > (http://cxf.apache.org/docs/servlet-transport.html) there are two ways
> > to use it:
> >
> > You can either use ContextLoaderListener from spring or let it pull up
> > a new context.
> >
> > I don´t know if it is only because of the second option but there is
> > some really ugly code in there to find or pull up an application
> > context and work directly with it.
> > So my point is that we should let spring do this. Can´t we just let
> > spring inject whatever we need?
> >
> > Best regards
> >
> > Christian
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Re: Discuss: CXFServlet and spring ApplicationContext
Posted by Christian Schneider <ch...@die-schneider.net>.
One thing I found is the spring DispatcherServlet:
http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/servlet/DispatcherServlet.html
Could we simply use this servlet to route requests to our services and
have no own servlet at all? Spring uses this for their own remoting
protocols.
Best regards
Christian
Am 30.11.2010 01:10, schrieb Christian Schneider:
> I am currently trying to dig deeper into the http transport.
>
> One part of the code that I really don´t like is the CXFServlet. If I
> understand correctly it is being used when you want to have a servlet
> transport together with a spring application context.
> In the documentation
> (http://cxf.apache.org/docs/servlet-transport.html) there are two ways
> to use it:
>
> You can either use ContextLoaderListener from spring or let it pull up
> a new context.
>
> I don´t know if it is only because of the second option but there is
> some really ugly code in there to find or pull up an application
> context and work directly with it.
> So my point is that we should let spring do this. Can´t we just let
> spring inject whatever we need?
>
> Best regards
>
> Christian
>
--
----
http://www.liquid-reality.de
Re: Discuss: CXFServlet and spring ApplicationContext
Posted by Craig Tataryn <cr...@tataryn.net>.
Actually it's used when you want to have web services reside within a Servlet container. It might be Spring aware, but should be Spring neutral. (AFAIK)
Craig.
On 2010-11-29, at 6:10 PM, Christian Schneider wrote:
> I am currently trying to dig deeper into the http transport.
>
> One part of the code that I really don´t like is the CXFServlet. If I understand correctly it is being used when you want to have a servlet transport together with a spring application context.
> In the documentation (http://cxf.apache.org/docs/servlet-transport.html) there are two ways to use it:
>
> You can either use ContextLoaderListener from spring or let it pull up a new context.
>
> I don´t know if it is only because of the second option but there is some really ugly code in there to find or pull up an application context and work directly with it.
> So my point is that we should let spring do this. Can´t we just let spring inject whatever we need?
>
> Best regards
>
> Christian
>
> --
> ----
> http://www.liquid-reality.de
>