diff --git a/vraptor-core/src/main/java/br/com/caelum/vraptor/view/Linker.java b/vraptor-core/src/main/java/br/com/caelum/vraptor/view/Linker.java index 96e02e92a..9b14bfb16 100644 --- a/vraptor-core/src/main/java/br/com/caelum/vraptor/view/Linker.java +++ b/vraptor-core/src/main/java/br/com/caelum/vraptor/view/Linker.java @@ -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) { @@ -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) {