Skip to content

Commit

Permalink
Grails GSP: fixes layout view not found
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboyan committed Apr 26, 2023
1 parent cd279f9 commit a7134ac
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,13 @@ protected View createGrailsView(String viewName) throws Exception {
if (LOG.isDebugEnabled()) {
LOG.debug(String.format("Locating GSP view for controller [%s] and path [%s]", controller, viewName));
}
String shortViewName = viewName.substring(viewName.lastIndexOf("/") + 1);
scriptSource = this.groovyPageLocator.findView(controller, shortViewName);
if (viewName.startsWith("/layouts")) {
scriptSource = this.groovyPageLocator.findView(controller, viewName);
}
else {
String shortViewName = viewName.substring(viewName.lastIndexOf("/") + 1);
scriptSource = this.groovyPageLocator.findView(controller, shortViewName);
}
}
if (scriptSource != null) {
return createGroovyPageView(scriptSource.getURI(), scriptSource);
Expand Down

0 comments on commit a7134ac

Please sign in to comment.