GroovyPageScriptSource scriptSource = findResourceScriptSource(uri);
if (scriptSource == null) {
GrailsPlugin pagePlugin = binding instanceof GroovyPageBinding ? ((GroovyPageBinding)binding).getPagePlugin() : null;
if (pagePlugin instanceof BinaryGrailsPlugin) {
BinaryGrailsPlugin binaryPlugin = (BinaryGrailsPlugin) pagePlugin;
scriptSource = resolveViewInBinaryPlugin(binaryPlugin, uri);
}
else if (pagePlugin != null) {
scriptSource = findResourceScriptSource(resolvePluginViewPath(uri, pagePlugin));
}