0
除了下面的方法之外,是否还有其他任何方式来验证查询参数值,即是否有通过映射到wadl的模式的Jersey方法。谢谢验证查询参数值球衣
@Path("smooth")
@GET
public Response smooth(
@DefaultValue("blue") @QueryParam("min-color") ColorParam minColor,
public class ColorParam extends Color {
public ColorParam(String s) {
super(getRGB(s));
}
private static int getRGB(String s) {
if (s.charAt(0) == '#') {
try {
Color c = Color.decode("0x" + s.substring(1));
return c.getRGB();
} catch (NumberFormatException e) {
throw new WebApplicationException(400);