users@jersey.java.net

[Jersey] Re: Invalid Parameter Format

From: Petr Jurák <petr.jurak_at_gmail.com>
Date: Tue, 23 Aug 2011 12:08:03 +0200

It could be done using parsing to number and catching NumberFormatException.

2011/8/23 etc <ecelino_at_gmail.com>:
> I am not really an AOP expert.
>
> The problem is even if AOP proxies my method:
>
> @Path("accounts/get")
> public Account getAccount(
>    @QueryParam("id")
>   @InvalidFormatError(12)
>   @RequiredParamError(21) Long id
>    ) {
>  return accountService.getAccount(id);
> }
>
> It is already too late for me. How can I determine if the parameter from
> Request (which is a string via HttpServletRequest.getParam) is numeric?
> Jersey framework will throw http Status 404 if the parameter is not numeric.
>
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/Invalid-Parameter-Format-tp6698976p6715485.html
> Sent from the Jersey mailing list archive at Nabble.com.
>