users@jersey.java.net

[Jersey] Re: Date parameter in the url

From: Paul <nibin.cse_at_gmail.com>
Date: Mon, 20 Jun 2011 05:49:00 -0700 (PDT)

For PathParam, the following are the valid paratemer types.

1. Primitive types.
2. Types that have a constructor that accepts a single String argument.
3. Types that have a static method named valueOf or fromString with a single
String argument
that return an instance of the type. If both methods are present then
valueOf MUST be used unless
the type is an enum in which case fromStringMUST be used.
4. List<T>, Set<T>, or SortedSet<T>, where T satisfies 2 or 3 above.

Since java.util.Date has a constructor that accepts string, I think
java.util.Date could be used as the parameter type.

But public Date(String s) constructor is deprecated.

And I don't think the date in the format (2011%06%17) is valid. The parsing
of the date string might fail. But if you provide the date in an acceptable
format, then I guess, it should work fine.

--
View this message in context: http://jersey.576304.n2.nabble.com/Date-parameter-in-the-url-tp6485543p6495635.html
Sent from the Jersey mailing list archive at Nabble.com.