You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by James Mao <ja...@iona.com> on 2006/10/26 11:16:16 UTC

Http path

In JettyHTTPDestination.setMessageObserver we have
 pathInContext.equals(getName())
May i change to pathInContext.startWith(getName()) ?

The reason is that in REST demo, we should be able to do this:
http://localhost:8080/jaxws-restful/addnumbers?num1=10&num2=20
And we also should be able to do this:
http://localhost:8080/jaxws-restful/addnumbers/num1/10/num2/20

In jaxws ri they support both, i think we should also support the last.

Thoughts?

James.

Re: Http path

Posted by Dan Diephouse <da...@envoisolutions.com>.
I don't think enabling by default is the right thing to do. I think it 
would be better to have the BindingFactory or the BindingInfoFactoryBean 
enable the property on the binding. Then all we need to do is have the 
http transport check the context hierarchy for whether or not 
"contextMatchStrategy" is set.

Cheers,
- Dan

James Mao wrote:

> Hi Dan,
>
> Thanks for your reply, but i'm not using in the test, i would like to 
> enable this by default, and i also think that we should allow user to 
> get the httpcontext, from that we can get the context path etc.
>
> Thanks,
> James.
>
> Dan Diephouse 写道:
>
>> James Mao wrote:
>>
>>> In JettyHTTPDestination.setMessageObserver we have
>>> pathInContext.equals(getName())
>>> May i change to pathInContext.startWith(getName()) ?
>>>
>>> The reason is that in REST demo, we should be able to do this:
>>> http://localhost:8080/jaxws-restful/addnumbers?num1=10&num2=20
>>> And we also should be able to do this:
>>> http://localhost:8080/jaxws-restful/addnumbers/num1/10/num2/20
>>>
>>> In jaxws ri they support both, i think we should also support the last.
>>>
>>> Thoughts?
>>>
>>> James.
>>
>>
>> You can change this by doing:
>>
>> endpointInfo.setProperty("contextMatchStrategy", "stem")
>>
>> If you're using the ServerFactoryBean you can set the properties on 
>> that, which will set the properties on the endpointinfo that is being 
>> created:
>>
>> http://fisheye3.cenqua.com/browse/celtixfire/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/wrapped/WrappedServiceTest.java?r=467687#l46 
>>
>>
>> - Dan
>>
>


-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com


Re: Http path

Posted by James Mao <ja...@iona.com>.
Hi Dan,

Thanks for your reply, but i'm not using in the test, i would like to 
enable this by default, and i also think that we should allow user to 
get the httpcontext, from that we can get the context path etc.

Thanks,
James.

Dan Diephouse 写道:
> James Mao wrote:
>
>> In JettyHTTPDestination.setMessageObserver we have
>> pathInContext.equals(getName())
>> May i change to pathInContext.startWith(getName()) ?
>>
>> The reason is that in REST demo, we should be able to do this:
>> http://localhost:8080/jaxws-restful/addnumbers?num1=10&num2=20
>> And we also should be able to do this:
>> http://localhost:8080/jaxws-restful/addnumbers/num1/10/num2/20
>>
>> In jaxws ri they support both, i think we should also support the last.
>>
>> Thoughts?
>>
>> James.
>
> You can change this by doing:
>
> endpointInfo.setProperty("contextMatchStrategy", "stem")
>
> If you're using the ServerFactoryBean you can set the properties on 
> that, which will set the properties on the endpointinfo that is being 
> created:
>
> http://fisheye3.cenqua.com/browse/celtixfire/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/wrapped/WrappedServiceTest.java?r=467687#l46 
>
>
> - Dan
>


Re: Http path

Posted by Dan Diephouse <da...@envoisolutions.com>.
James Mao wrote:

> In JettyHTTPDestination.setMessageObserver we have
> pathInContext.equals(getName())
> May i change to pathInContext.startWith(getName()) ?
>
> The reason is that in REST demo, we should be able to do this:
> http://localhost:8080/jaxws-restful/addnumbers?num1=10&num2=20
> And we also should be able to do this:
> http://localhost:8080/jaxws-restful/addnumbers/num1/10/num2/20
>
> In jaxws ri they support both, i think we should also support the last.
>
> Thoughts?
>
> James.

You can change this by doing:

endpointInfo.setProperty("contextMatchStrategy", "stem")

If you're using the ServerFactoryBean you can set the properties on 
that, which will set the properties on the endpointinfo that is being 
created:

http://fisheye3.cenqua.com/browse/celtixfire/trunk/rt/bindings/http/src/test/java/org/apache/cxf/binding/http/wrapped/WrappedServiceTest.java?r=467687#l46

- Dan

-- 
Dan Diephouse
(616) 971-2053
Envoi Solutions LLC
http://netzooid.com