users@jersey.java.net

Example 2.13: Custom Java type for consuming header/request parameters

From: Olson, Dan (LNG-CSP) <"Olson,>
Date: Mon, 4 Oct 2010 18:40:18 +0000

Hi,

When using a custom class type for parameters and the specified parameter name used in @HeaderParam or @QueryParam does not exist it the parameter value is null. It seems that the custom class is not given the opportunity to process an empty string (or null) as input; construction is completely bypassed in favor of a null value.

Can this behavior be modified or otherwise handled so that the custom class can take action? One workaround is to use @DefaultValue to provide a non-null value. Unfortunately that clutters the solution somewhat.

Your thoughts would be appreciated.

Regards,

Dan