users@jsr311.java.net

Re: PathParam and DefaultValue

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 14 May 2009 10:30:39 -0400

On May 14, 2009, at 7:02 AM, Sergey Beryozkin wrote:

> Hi
>
> in what cases specifying @DefaultValue for @PathParam annotated
> method parameters actually works ?
>
> For example, a method match can be successful even if a given query
> or matrix parameter is not available thus DefaultValue if any will
> be applied to an argument with no matching query/matrix parameter.
>
> @PathParams are populated from template variable instances created
> during evaluating @Path expressions.
>
> Thus it is not clear to me when a method which has been matched
> after successfully evaluating one or more Path expressions
> can have @PathParams to which a DefaultValue would apply...
>
> Can someone give an example please ? Does it work for Path variables
> which allow for no data using custom regular expressions ?
>
That's the only case I can think of.

Marc.