|
From: Martin A. <sp...@ma...> - 2008-06-16 10:39:12
|
In my code I have the following subresource locator:
@Path("{number}")
public AccountResource getAccount( @PathParam("number") int
number ) {
This is the only method that can match anything. If I pass in
something that can not get interpreted as a string I get a 500 and a
NumberFormatException - which doesn't seem entirely right. However
from the spec I struggle to work out what it should be. 404? 400?. I
plan to file it as a bug, but would like to provide a test case for it
as well - so I need to work out the wanted behaviour.
Here's the stack trace:
java.lang.NumberFormatException: For input string: "q"
at
java
.lang.NumberFormatException.forInputString(NumberFormatException.java:
48)
at java.lang.Integer.parseInt(Integer.java:447)
at java.lang.Integer.valueOf(Integer.java:553)
at
org
.resteasy
.util
.StringToPrimitive.stringToPrimitiveBoxType(StringToPrimitive.java:18)
at
org
.resteasy
.StringParameterInjector.extractValue(StringParameterInjector.java:143)
at org.resteasy.PathParamInjector.inject(PathParamInjector.java:44)
at
org
.resteasy.MethodInjectorImpl.injectArguments(MethodInjectorImpl.java:53)
at org.resteasy.ResourceLocator.createResource(ResourceLocator.java:64)
Martin
|