@Test public void shouldUseResourceTypeAndMethodNameToResolveJsp(){ when(formatResolver.getAcceptFormat()).thenReturn(null); String result = resolver.pathFor(method); assertThat(result, is("/WEB-INF/jsp/dog/bark.jsp")); }
public String pathFor(ResourceMethod method) { String format = resolver.getAcceptFormat(); String suffix = ""; if (format != null && !format.equals("html")) { suffix = '.' + format; } String name = method.getResource().getType().getSimpleName(); String folderName = extractControllerFromName(name); return getPrefix() + folderName + '/' + method.getMethod().getName() + suffix + '.' +getExtension(); }
DefaultPathResolver implements PathResolver { public String pathFor(ResourceMethod method) { String format = resolver.getAcceptFormat(); String suffix = ""; if (format != null && !format.equals("html")) { suffix = '.' + format; } String name = method.getResource().getType().getSimpleName(); String folderName = extractControllerFromName(name); return getPrefix() + folderName + '/' + method.getMethod().getName() + suffix + '.' +getExtension(); } }
DefaultPathResolver implements PathResolver { public String pathFor(ResourceMethod method) { String format = resolver.getAcceptFormat(); String suffix = ""; if (format != null && !format.equals("html")) { suffix = '.' + format; } String name = method.getResource().getType().getSimpleName(); String folderName = extractControllerFromName(name); return getPrefix() + folderName + '/' + method.getMethod().getName() + suffix + '.' +getExtension(); } DefaultPathResolver(FormatResolver resolver); }
DefaultPathResolver implements PathResolver { public String pathFor(ResourceMethod method) { String format = resolver.getAcceptFormat(); String suffix = ""; if (format != null && !format.equals("html")) { suffix = '.' + format; } String name = method.getResource().getType().getSimpleName(); String folderName = extractControllerFromName(name); return getPrefix() + folderName + '/' + method.getMethod().getName() + suffix + '.' +getExtension(); } DefaultPathResolver(FormatResolver resolver); String pathFor(ResourceMethod method); }
DefaultPathResolver implements PathResolver { public String pathFor(ResourceMethod method) { String format = resolver.getAcceptFormat(); String suffix = ""; if (format != null && !format.equals("html")) { suffix = '.' + format; } String name = method.getResource().getType().getSimpleName(); String folderName = extractControllerFromName(name); return getPrefix() + folderName + '/' + method.getMethod().getName() + suffix + '.' +getExtension(); } DefaultPathResolver(FormatResolver resolver); String pathFor(ResourceMethod method);  }