users@jsr311.java.net

Valid paramer types and exception handling

From: Sergey Beryozkin <sergey.beryozkin_at_progress.com>
Date: Wed, 14 Jan 2009 15:24:51 -0000

Hi

Section 3.2 says that types which have a constructor that accepts a single String argument or a static method valueOf(String) are
supported. Also, the section says that WebApplicationException needs to be thrown if exception occurs during the object construction
(using constructor or valueOf)

few questions.

1. what should happen if a given parameter type has no valid constructor or valueOf() - should an exception be thrown or a null
value returned ?

2. Some Java types such as java.util.UUID have no valueOf(String) but have fromString(String) method instead. Would it make sense to
have such methods evaluated too ?

3. What HTTP status code should be set if an exception occurs during a @FormParam parameter construction - 404 or 400

4. If a field initialization fails due to SecurityManager restrictions then will it also be treated as a client error ?

thanks
Sergey