-
Bug
-
Resolution: Done
-
Major
-
2.0.1.GA
-
None
-
None
JSR 311 Javadoc for PathParam annotation (https://jsr311.dev.java.net/nonav/javadoc/index.html) says:
The type of the annotated parameter, field or property must either:
....
Have a static method named valueOf or fromString that accepts a single String argument (see, for example, Integer.valueOf(String))
....
RESTEasy doesn't support the fromString variant. When I try to deploy resource with this kind of method, it fails with:
java.lang.RuntimeException: Unable to find a constructor that takes a String param or a valueOf() method for javax.ws.rs.PathParam("var") on public java.lang.String org.jboss.resteasy.exttests.params.ParamTestResource.pathparam(org.jboss.resteasy.exttests.params.Box3) for basetype: org.jboss.resteasy.exttests.params.Box3
The method in the resource looks like this:
-----------------------
@GET
@Path("/pathparam15/
")
public String pathparam(@PathParam("var") Box3 var)
the Box3 class looks like this:
-----------------------
package org.jboss.resteasy.exttests.params;
/**
- A class with fromString(String) method.
*/
public class Box3 {
private String content;
public static Box3 fromString(String aBox3)
{ Box3 r = new Box3(); r.content = aBox3; return r; }public String getContent()
{ return content; }public void setContent(String content)
{ this.content = content; } @Override
public String toString()
}