Skip to content

Commit

Permalink
Merge pull request #730 from dtelaroli/master
Browse files Browse the repository at this point in the history
Open Linker for extension
  • Loading branch information
Turini committed Aug 11, 2014
2 parents 3496c51 + 202264a commit a39f72e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions vraptor-core/src/main/java/br/com/caelum/vraptor/view/Linker.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ public Linker(ServletContext context, Router router, Class<?> controller, String
}

protected String getLink() {
Method method = getMethod();
return getPrefix() + router.urlFor(controller, method, getArgs(method));
}

protected String getPrefix() {
return context.getContextPath();
}

protected Method getMethod() {
Method method = null;

if (countMethodsWithSameName() > 1) {
Expand All @@ -60,8 +69,7 @@ protected String getLink() {
String.format("There are no methods on %s named '%s' that receives args of types %s",
controller, methodName, Arrays.toString(getClasses(args))));
}

return context.getContextPath() + router.urlFor(controller, method, getArgs(method));
return method;
}

protected Object[] getArgs(Method method) {
Expand Down

0 comments on commit a39f72e

Please sign in to comment.