dev@jersey.java.net

Re: [Jersey] Nullable Path Param

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 08 Jan 2009 17:10:16 +0100

Hi Flaiz,

There is no special mapping of the String value "null" to null in Java
for @*Param. You will need to that that mapping yourself.

Do you really want to have the "null" string in the URLs or do you
want the absence. If the url template value is "null" or absent will
the formatId template valuebe absent as well?

My hunch is that url and formatId need to be query parameters. Then
you can use @DefaultValue @QueryParam.

Paul.



On Jan 8, 2009, at 4:59 PM, Зоряна wrote:

> Hello.
>
>
> Maybe this is simple question ... How can I set up null value into
> @PathParam
> I have next WS UTL: http:\\localhost:8080\wsTest\items\{itemId}\
> {formatId}\{url}
> where Integer formatId and String url can be null, in this case I
> will use default format and default url.
>
> When I try http:\\localhost:8080\wsTest\items\1\1\ I am getting
> response with status 404
> When I try http:\\localhost:8080\wsTest\items\1\1\null In this case
> null is string, but not real null
> When I try http:\\localhost:8080\wsTest\items\1\null\null Again 404
> status, because null is string but {formatId} is Integer
>
> Can You help me.
> I didn't find helpful information in the net
>
> Thanks,
> Flaiz
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>