Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
Fixes resolve views in the 'app/views/' of BinaryPlugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboyan committed Sep 29, 2022
1 parent fbf1bd1 commit a71f72b
Showing 1 changed file with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,16 +213,21 @@ else if (pagePlugin != null) {
}

protected GroovyPageScriptSource resolveViewInBinaryPlugin(BinaryGrailsPlugin binaryPlugin, String uri) {
GroovyPageScriptSource scriptSource = null;
uri = removeViewLocationPrefixes(uri);
uri = GrailsResourceUtils.appendPiecesForUri(PATH_TO_WEB_INF_VIEWS, uri);
Class<?> viewClass = binaryPlugin.resolveView(uri);
if (viewClass != null && !this.reloadedPrecompiledGspClassNames.contains(viewClass.getName())) {
scriptSource = createGroovyPageCompiledScriptSource(uri, uri, viewClass);
// we know we have binary plugin, sp setting to null in the resourceCallable to skip reloading.
((GroovyPageCompiledScriptSource) scriptSource).setResourceCallable(null);
for (String dir : Arrays.asList("grails-app", "app")) {
GroovyPageScriptSource scriptSource = null;
String fullUri = removeViewLocationPrefixes(uri);
fullUri = GrailsResourceUtils.appendPiecesForUri("/WEB-INF/" + dir + "/views", fullUri);
Class<?> viewClass = binaryPlugin.resolveView(fullUri);
if (viewClass != null && !this.reloadedPrecompiledGspClassNames.contains(viewClass.getName())) {
scriptSource = createGroovyPageCompiledScriptSource(uri, fullUri, viewClass);
// we know we have binary plugin, sp setting to null in the resourceCallable to skip reloading.
((GroovyPageCompiledScriptSource) scriptSource).setResourceCallable(null);
}
if (scriptSource != null) {
return scriptSource;
}
}
return scriptSource;
return null;
}

protected GroovyPageCompiledScriptSource createGroovyPageCompiledScriptSource(final String uri, String fullPath, Class<?> viewClass) {
Expand Down

0 comments on commit a71f72b

Please sign in to comment.