You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2011/04/16 23:02:03 UTC

2.3.2: I lose the 'what services' page when I drop a jax-rs service at /

I configure my servlet mapping for '/services/*'.

I then give a jaxrs:server an address='/'.

So, I figure, since each of my service classes has an @Path, I'll
still get the CXF service listing at http://localhost/webapp/services.
No Such Luck. Services work, but no service config page.

Is this a reasonable thing to expect, or have I shaded it out?

Re: 2.3.2: I lose the 'what services' page when I drop a jax-rs service at /

Posted by Sergey Beryozkin <sb...@gmail.com>.
Or, when having "/services/*" and jaxrs:address "/", see if the initial
part of the @Path value on the root resource can be 'shifted' to
jaxrs:address, ex, the following:

CXFServlet: /services/*
jaxrs:address = "/"

@Path("customers")
public class Customers {

@GET
@Path("orders")
public Orders getOrders() {
}

}

can be changed to

 CXFServlet: /services/*
jaxrs:address = "/customers"

@Path("/")
public class Customers {

@GET
@Path("orders")
public Orders getOrders() {
}

}

and the 3rd option (in addition to the above one and overriding the services
page address with the servlet-list-path) is not use "/services/*" servlet
pattern at all - if it makes sense for a given URI space

Cheers, Sergey

On Mon, Apr 18, 2011 at 8:15 AM, Sergey Beryozkin <sb...@gmail.com>wrote:

> Hi Benson, Dennis
>
> On Sun, Apr 17, 2011 at 12:41 PM, Benson Margulies <bi...@gmail.com>wrote:
>
>> Dennis,
>>
>> As I tried to explain, the whole business works fine if I use URLs of the
>> form:
>>
>> http://thehost/theservlet/services/services/theservice/themethod
>>
>
> There's no need to have "/services/services" in URIs, just have a "/*"
> servlet pattern and a jaxrs:server "/services" or
> "/services" and "/" - but in this latter case CXFServlet needs to be
> configured with the "service-list-path" parameter such as "/theservices",
> etc, so
>
> http://thehost/theservlet/theservices
>
> will give you the list of services.
>
> Cheers, Sergey
>
>>
>> I just found it esthetically annoying :-)
>>
>> --benson
>>
>>
>> On Sat, Apr 16, 2011 at 8:58 PM, Dennis Sosnoski <dm...@sosnoski.com>
>> wrote:
>> > If you have static content I'd think you'd need a real path for the
>> > servlet, not just /*. But using your servlet mapping /services/* did you
>> > try browsing to http://localhost/webapp/services/services? My point was
>> > that I'd found I needed the extra "/services" in the URL to get the
>> > service config page, and I thought it might be the same in your setup.
>> >
>> >  - Dennis
>> >
>> >
>> > On 04/17/2011 11:15 AM, Benson Margulies wrote:
>> >> Dennis,
>> >>
>> >> All works fine if I configure address="/services" and go there.
>> >>
>> >> Since I have some static content, I'm a bit leary of /*, but should I
>> be?
>> >>
>> >>
>> >>
>> >> On Sat, Apr 16, 2011 at 5:46 PM, Dennis Sosnoski <dm...@sosnoski.com>
>> wrote:
>> >>> Try browsing to /services/services. I use <url-pattern>/*<url-pattern>
>> >>> with 2.3.3 to have the REST service accessed at
>> >>> http://host:port/war-name and find the services page shows up at
>> >>> http://host:port/war-name/services
>> >>>
>> >>>  - Dennis
>> >>>
>> >>> Dennis M. Sosnoski
>> >>> Java SOA and Web Services Consulting <
>> http://www.sosnoski.com/consult.html>
>> >>> Axis2/CXF/Metro SOA and Web Services Training
>> >>> <http://www.sosnoski.com/training.html>
>> >>> Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
>> >>>
>> >>>
>> >>> On 04/17/2011 09:02 AM, Benson Margulies wrote:
>> >>>> I configure my servlet mapping for '/services/*'.
>> >>>>
>> >>>> I then give a jaxrs:server an address='/'.
>> >>>>
>> >>>> So, I figure, since each of my service classes has an @Path, I'll
>> >>>> still get the CXF service listing at
>> http://localhost/webapp/services.
>> >>>> No Such Luck. Services work, but no service config page.
>> >>>>
>> >>>> Is this a reasonable thing to expect, or have I shaded it out?
>> >>>>
>> >
>>
>
>
>


-- 
Sergey Beryozkin

Application Integration Division of Talend <http://www.talend.com/>
http://sberyozkin.blogspot.com

Re: 2.3.2: I lose the 'what services' page when I drop a jax-rs service at /

Posted by Sergey Beryozkin <sb...@gmail.com>.
I forgot you said you had some static content; in that case, but only if you
choose, to have a "/*" servlet pattern, you should configure a static
content redirection for the default servlet (the one which usually serves
the static content) to handle it, see

http://cxf.apache.org/docs/servlet-transport.html

use redirects-list (space separated list of regexps, ex, */(\w)+.html*) and
redirect-servlet-name (should be 'default')
Cheers, Sergey
On Mon, Apr 18, 2011 at 4:01 PM, Benson Margulies <bi...@gmail.com>wrote:

> Sergey,
>
> I'm not a great web.xml expert. Will my static pages still work?
>
> On Mon, Apr 18, 2011 at 3:15 AM, Sergey Beryozkin <sb...@gmail.com>
> wrote:
> > Hi Benson, Dennis
> >
> > On Sun, Apr 17, 2011 at 12:41 PM, Benson Margulies <
> bimargulies@gmail.com>wrote:
> >
> >> Dennis,
> >>
> >> As I tried to explain, the whole business works fine if I use URLs of
> the
> >> form:
> >>
> >> http://thehost/theservlet/services/services/theservice/themethod
> >>
> >
> > There's no need to have "/services/services" in URIs, just have a "/*"
> > servlet pattern and a jaxrs:server "/services" or
> > "/services" and "/" - but in this latter case CXFServlet needs to be
> > configured with the "service-list-path" parameter such as "/theservices",
> > etc, so
> >
> > http://thehost/theservlet/theservices
> >
> > will give you the list of services.
> >
> > Cheers, Sergey
> >
> >>
> >> I just found it esthetically annoying :-)
> >>
> >> --benson
> >>
> >>
> >> On Sat, Apr 16, 2011 at 8:58 PM, Dennis Sosnoski <dm...@sosnoski.com>
> wrote:
> >> > If you have static content I'd think you'd need a real path for the
> >> > servlet, not just /*. But using your servlet mapping /services/* did
> you
> >> > try browsing to http://localhost/webapp/services/services? My point
> was
> >> > that I'd found I needed the extra "/services" in the URL to get the
> >> > service config page, and I thought it might be the same in your setup.
> >> >
> >> >  - Dennis
> >> >
> >> >
> >> > On 04/17/2011 11:15 AM, Benson Margulies wrote:
> >> >> Dennis,
> >> >>
> >> >> All works fine if I configure address="/services" and go there.
> >> >>
> >> >> Since I have some static content, I'm a bit leary of /*, but should I
> >> be?
> >> >>
> >> >>
> >> >>
> >> >> On Sat, Apr 16, 2011 at 5:46 PM, Dennis Sosnoski <dm...@sosnoski.com>
> >> wrote:
> >> >>> Try browsing to /services/services. I use
> <url-pattern>/*<url-pattern>
> >> >>> with 2.3.3 to have the REST service accessed at
> >> >>> http://host:port/war-name and find the services page shows up at
> >> >>> http://host:port/war-name/services
> >> >>>
> >> >>>  - Dennis
> >> >>>
> >> >>> Dennis M. Sosnoski
> >> >>> Java SOA and Web Services Consulting <
> >> http://www.sosnoski.com/consult.html>
> >> >>> Axis2/CXF/Metro SOA and Web Services Training
> >> >>> <http://www.sosnoski.com/training.html>
> >> >>> Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
> >> >>>
> >> >>>
> >> >>> On 04/17/2011 09:02 AM, Benson Margulies wrote:
> >> >>>> I configure my servlet mapping for '/services/*'.
> >> >>>>
> >> >>>> I then give a jaxrs:server an address='/'.
> >> >>>>
> >> >>>> So, I figure, since each of my service classes has an @Path, I'll
> >> >>>> still get the CXF service listing at
> http://localhost/webapp/services
> >> .
> >> >>>> No Such Luck. Services work, but no service config page.
> >> >>>>
> >> >>>> Is this a reasonable thing to expect, or have I shaded it out?
> >> >>>>
> >> >
> >>
> >
>



-- 
Sergey Beryozkin

Application Integration Division of Talend <http://www.talend.com/>
http://sberyozkin.blogspot.com

Re: 2.3.2: I lose the 'what services' page when I drop a jax-rs service at /

Posted by Benson Margulies <bi...@gmail.com>.
Sergey,

I'm not a great web.xml expert. Will my static pages still work?

On Mon, Apr 18, 2011 at 3:15 AM, Sergey Beryozkin <sb...@gmail.com> wrote:
> Hi Benson, Dennis
>
> On Sun, Apr 17, 2011 at 12:41 PM, Benson Margulies <bi...@gmail.com>wrote:
>
>> Dennis,
>>
>> As I tried to explain, the whole business works fine if I use URLs of the
>> form:
>>
>> http://thehost/theservlet/services/services/theservice/themethod
>>
>
> There's no need to have "/services/services" in URIs, just have a "/*"
> servlet pattern and a jaxrs:server "/services" or
> "/services" and "/" - but in this latter case CXFServlet needs to be
> configured with the "service-list-path" parameter such as "/theservices",
> etc, so
>
> http://thehost/theservlet/theservices
>
> will give you the list of services.
>
> Cheers, Sergey
>
>>
>> I just found it esthetically annoying :-)
>>
>> --benson
>>
>>
>> On Sat, Apr 16, 2011 at 8:58 PM, Dennis Sosnoski <dm...@sosnoski.com> wrote:
>> > If you have static content I'd think you'd need a real path for the
>> > servlet, not just /*. But using your servlet mapping /services/* did you
>> > try browsing to http://localhost/webapp/services/services? My point was
>> > that I'd found I needed the extra "/services" in the URL to get the
>> > service config page, and I thought it might be the same in your setup.
>> >
>> >  - Dennis
>> >
>> >
>> > On 04/17/2011 11:15 AM, Benson Margulies wrote:
>> >> Dennis,
>> >>
>> >> All works fine if I configure address="/services" and go there.
>> >>
>> >> Since I have some static content, I'm a bit leary of /*, but should I
>> be?
>> >>
>> >>
>> >>
>> >> On Sat, Apr 16, 2011 at 5:46 PM, Dennis Sosnoski <dm...@sosnoski.com>
>> wrote:
>> >>> Try browsing to /services/services. I use <url-pattern>/*<url-pattern>
>> >>> with 2.3.3 to have the REST service accessed at
>> >>> http://host:port/war-name and find the services page shows up at
>> >>> http://host:port/war-name/services
>> >>>
>> >>>  - Dennis
>> >>>
>> >>> Dennis M. Sosnoski
>> >>> Java SOA and Web Services Consulting <
>> http://www.sosnoski.com/consult.html>
>> >>> Axis2/CXF/Metro SOA and Web Services Training
>> >>> <http://www.sosnoski.com/training.html>
>> >>> Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
>> >>>
>> >>>
>> >>> On 04/17/2011 09:02 AM, Benson Margulies wrote:
>> >>>> I configure my servlet mapping for '/services/*'.
>> >>>>
>> >>>> I then give a jaxrs:server an address='/'.
>> >>>>
>> >>>> So, I figure, since each of my service classes has an @Path, I'll
>> >>>> still get the CXF service listing at http://localhost/webapp/services
>> .
>> >>>> No Such Luck. Services work, but no service config page.
>> >>>>
>> >>>> Is this a reasonable thing to expect, or have I shaded it out?
>> >>>>
>> >
>>
>

Re: 2.3.2: I lose the 'what services' page when I drop a jax-rs service at /

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Benson, Dennis

On Sun, Apr 17, 2011 at 12:41 PM, Benson Margulies <bi...@gmail.com>wrote:

> Dennis,
>
> As I tried to explain, the whole business works fine if I use URLs of the
> form:
>
> http://thehost/theservlet/services/services/theservice/themethod
>

There's no need to have "/services/services" in URIs, just have a "/*"
servlet pattern and a jaxrs:server "/services" or
"/services" and "/" - but in this latter case CXFServlet needs to be
configured with the "service-list-path" parameter such as "/theservices",
etc, so

http://thehost/theservlet/theservices

will give you the list of services.

Cheers, Sergey

>
> I just found it esthetically annoying :-)
>
> --benson
>
>
> On Sat, Apr 16, 2011 at 8:58 PM, Dennis Sosnoski <dm...@sosnoski.com> wrote:
> > If you have static content I'd think you'd need a real path for the
> > servlet, not just /*. But using your servlet mapping /services/* did you
> > try browsing to http://localhost/webapp/services/services? My point was
> > that I'd found I needed the extra "/services" in the URL to get the
> > service config page, and I thought it might be the same in your setup.
> >
> >  - Dennis
> >
> >
> > On 04/17/2011 11:15 AM, Benson Margulies wrote:
> >> Dennis,
> >>
> >> All works fine if I configure address="/services" and go there.
> >>
> >> Since I have some static content, I'm a bit leary of /*, but should I
> be?
> >>
> >>
> >>
> >> On Sat, Apr 16, 2011 at 5:46 PM, Dennis Sosnoski <dm...@sosnoski.com>
> wrote:
> >>> Try browsing to /services/services. I use <url-pattern>/*<url-pattern>
> >>> with 2.3.3 to have the REST service accessed at
> >>> http://host:port/war-name and find the services page shows up at
> >>> http://host:port/war-name/services
> >>>
> >>>  - Dennis
> >>>
> >>> Dennis M. Sosnoski
> >>> Java SOA and Web Services Consulting <
> http://www.sosnoski.com/consult.html>
> >>> Axis2/CXF/Metro SOA and Web Services Training
> >>> <http://www.sosnoski.com/training.html>
> >>> Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
> >>>
> >>>
> >>> On 04/17/2011 09:02 AM, Benson Margulies wrote:
> >>>> I configure my servlet mapping for '/services/*'.
> >>>>
> >>>> I then give a jaxrs:server an address='/'.
> >>>>
> >>>> So, I figure, since each of my service classes has an @Path, I'll
> >>>> still get the CXF service listing at http://localhost/webapp/services
> .
> >>>> No Such Luck. Services work, but no service config page.
> >>>>
> >>>> Is this a reasonable thing to expect, or have I shaded it out?
> >>>>
> >
>

Re: 2.3.2: I lose the 'what services' page when I drop a jax-rs service at /

Posted by Benson Margulies <bi...@gmail.com>.
Dennis,

As I tried to explain, the whole business works fine if I use URLs of the form:

http://thehost/theservlet/services/services/theservice/themethod

I just found it esthetically annoying :-)

--benson


On Sat, Apr 16, 2011 at 8:58 PM, Dennis Sosnoski <dm...@sosnoski.com> wrote:
> If you have static content I'd think you'd need a real path for the
> servlet, not just /*. But using your servlet mapping /services/* did you
> try browsing to http://localhost/webapp/services/services? My point was
> that I'd found I needed the extra "/services" in the URL to get the
> service config page, and I thought it might be the same in your setup.
>
>  - Dennis
>
>
> On 04/17/2011 11:15 AM, Benson Margulies wrote:
>> Dennis,
>>
>> All works fine if I configure address="/services" and go there.
>>
>> Since I have some static content, I'm a bit leary of /*, but should I be?
>>
>>
>>
>> On Sat, Apr 16, 2011 at 5:46 PM, Dennis Sosnoski <dm...@sosnoski.com> wrote:
>>> Try browsing to /services/services. I use <url-pattern>/*<url-pattern>
>>> with 2.3.3 to have the REST service accessed at
>>> http://host:port/war-name and find the services page shows up at
>>> http://host:port/war-name/services
>>>
>>>  - Dennis
>>>
>>> Dennis M. Sosnoski
>>> Java SOA and Web Services Consulting <http://www.sosnoski.com/consult.html>
>>> Axis2/CXF/Metro SOA and Web Services Training
>>> <http://www.sosnoski.com/training.html>
>>> Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
>>>
>>>
>>> On 04/17/2011 09:02 AM, Benson Margulies wrote:
>>>> I configure my servlet mapping for '/services/*'.
>>>>
>>>> I then give a jaxrs:server an address='/'.
>>>>
>>>> So, I figure, since each of my service classes has an @Path, I'll
>>>> still get the CXF service listing at http://localhost/webapp/services.
>>>> No Such Luck. Services work, but no service config page.
>>>>
>>>> Is this a reasonable thing to expect, or have I shaded it out?
>>>>
>

Re: 2.3.2: I lose the 'what services' page when I drop a jax-rs service at /

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
If you have static content I'd think you'd need a real path for the
servlet, not just /*. But using your servlet mapping /services/* did you
try browsing to http://localhost/webapp/services/services? My point was
that I'd found I needed the extra "/services" in the URL to get the
service config page, and I thought it might be the same in your setup.

  - Dennis


On 04/17/2011 11:15 AM, Benson Margulies wrote:
> Dennis,
>
> All works fine if I configure address="/services" and go there.
>
> Since I have some static content, I'm a bit leary of /*, but should I be?
>
>
>
> On Sat, Apr 16, 2011 at 5:46 PM, Dennis Sosnoski <dm...@sosnoski.com> wrote:
>> Try browsing to /services/services. I use <url-pattern>/*<url-pattern>
>> with 2.3.3 to have the REST service accessed at
>> http://host:port/war-name and find the services page shows up at
>> http://host:port/war-name/services
>>
>>  - Dennis
>>
>> Dennis M. Sosnoski
>> Java SOA and Web Services Consulting <http://www.sosnoski.com/consult.html>
>> Axis2/CXF/Metro SOA and Web Services Training
>> <http://www.sosnoski.com/training.html>
>> Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
>>
>>
>> On 04/17/2011 09:02 AM, Benson Margulies wrote:
>>> I configure my servlet mapping for '/services/*'.
>>>
>>> I then give a jaxrs:server an address='/'.
>>>
>>> So, I figure, since each of my service classes has an @Path, I'll
>>> still get the CXF service listing at http://localhost/webapp/services.
>>> No Such Luck. Services work, but no service config page.
>>>
>>> Is this a reasonable thing to expect, or have I shaded it out?
>>>

Re: 2.3.2: I lose the 'what services' page when I drop a jax-rs service at /

Posted by Benson Margulies <bi...@gmail.com>.
Dennis,

All works fine if I configure address="/services" and go there.

Since I have some static content, I'm a bit leary of /*, but should I be?



On Sat, Apr 16, 2011 at 5:46 PM, Dennis Sosnoski <dm...@sosnoski.com> wrote:
> Try browsing to /services/services. I use <url-pattern>/*<url-pattern>
> with 2.3.3 to have the REST service accessed at
> http://host:port/war-name and find the services page shows up at
> http://host:port/war-name/services
>
>  - Dennis
>
> Dennis M. Sosnoski
> Java SOA and Web Services Consulting <http://www.sosnoski.com/consult.html>
> Axis2/CXF/Metro SOA and Web Services Training
> <http://www.sosnoski.com/training.html>
> Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>
>
>
> On 04/17/2011 09:02 AM, Benson Margulies wrote:
>> I configure my servlet mapping for '/services/*'.
>>
>> I then give a jaxrs:server an address='/'.
>>
>> So, I figure, since each of my service classes has an @Path, I'll
>> still get the CXF service listing at http://localhost/webapp/services.
>> No Such Luck. Services work, but no service config page.
>>
>> Is this a reasonable thing to expect, or have I shaded it out?
>>
>

Re: 2.3.2: I lose the 'what services' page when I drop a jax-rs service at /

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Try browsing to /services/services. I use <url-pattern>/*<url-pattern>
with 2.3.3 to have the REST service accessed at
http://host:port/war-name and find the services page shows up at
http://host:port/war-name/services

  - Dennis

Dennis M. Sosnoski
Java SOA and Web Services Consulting <http://www.sosnoski.com/consult.html>
Axis2/CXF/Metro SOA and Web Services Training
<http://www.sosnoski.com/training.html>
Web Services Jump-Start <http://www.sosnoski.com/jumpstart.html>


On 04/17/2011 09:02 AM, Benson Margulies wrote:
> I configure my servlet mapping for '/services/*'.
>
> I then give a jaxrs:server an address='/'.
>
> So, I figure, since each of my service classes has an @Path, I'll
> still get the CXF service listing at http://localhost/webapp/services.
> No Such Luck. Services work, but no service config page.
>
> Is this a reasonable thing to expect, or have I shaded it out?
>