if (matches.hasNext()) {
try {
ResourceMethod resourceMethod = DefaultResourceMethod.instanceFor(type, method);
return matches.next().urlFor(type, method, creator.instanceWithParameters(resourceMethod, params));
} catch (Exception e) {
throw new VRaptorException("The selected route is invalid for redirection: " + type.getName() + "."
+ method.getName(), e);
}
}
throw new RouteNotFoundException("The selected route is invalid for redirection: " + type.getName() + "."
+ method.getName());