dev@jersey.java.net

Re: MatrixParam help?

From: Peter Liu <Peter.Liu_at_Sun.COM>
Date: Thu, 01 Nov 2007 10:41:22 -0700

Thanks. We will try it out.

Peter

Marc Hadley wrote:
> On Oct 31, 2007, at 3:25 PM, Marc Hadley wrote:
>>
>> If its urgent I could try to hack in support now but all things being
>> equal I'd rather wait for the resource model API to be completed
>> since all the WADL generation code will need to be rewritten once
>> that is available.
>>
> I took a look at the required changes to support matrix parameters in
> WADL generation and they were sufficiently small that I went ahead and
> added them to the 0.4 code anyway. I've tested that it works locally
> by running a few of the examples and modding them to use matrix params
> instead of query params and everything seems to work fine, let me know
> if you run into any issues.
>
> Marc.
>
>>
>>>
>>> Ayub Khan wrote:
>>>> Hi Paul,
>>>> With 0.4ea jersey available in REST modules of NB6.0 trunk.
>>>> I was trying MatrixParam annotation.
>>>> /**
>>>> * Retrieves representation of an instance of
>>>> hello.HelloWorldResource
>>>> * @return an instance of java.lang.String
>>>> */
>>>> @HttpMethod("GET")
>>>> @ProduceMime("application/xml")
>>>> public String getXml(@MatrixParam("name") String name) {
>>>> return "<?xml version='1.0' encoding='UTF-8'?>\n<b>Hello
>>>> "+name+"</b>";
>>>> }
>>>> After deploying the app, if I try the URL
>>>> http://localhost:8080/CustomerDB/resources/hello3;name=test
>>>> I get 404 error on the browser.
>>>> Also checked the wadl, it does not have a param element
>>>> (I was expecting this element also to have a style="matrix"
>>>> attribute) for the resource hello3.
>>>> application.wadl
>>>> ---------------------
>>>> ...
>>>> <resource path="hello3">
>>>> <method name="GET">
>>>> <request>
>>>> <representation/>
>>>> </request>
>>>> <response>
>>>> <representation mediaType="application/xml"/>
>>>> </response>
>>>> </method>
>>>> ...
>>>> ----------------------
>>>> Can you please provide a sample and how to test it.
>>>> Thanks
>>>> Ayub
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>>>
>>> --
>>> | ? + ? = To question
>>> ----------------\
>>> Paul Sandoz
>>> x38109
>>> +33-4-76188109
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
>>> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>>>
>>
>> ---
>> Marc Hadley <marc.hadley at sun.com>
>> CTO Office, Sun Microsystems.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>>
>
> ---
> Marc Hadley <marc.hadley at sun.com>
> CTO Office, Sun Microsystems.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>