Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.3.5
-
Fix Version/s: 2.0-M2
-
Component/s: None
-
Labels:None
Description
I have a plugin which contains our site layout, which is installed in our host application's BuildConfig.groovy under the plugins section (the only way to do it as it's group id should not be the default org.grails.plugins). I reference this layout in Config.groovy as using 'grails.sitemesh.default.layout' (though the problem is the same when I use '<meta name="layout" content="mypluginlayout" />').
When I run the host application using 'grails run-app' the layout renders correctly, however when run as a war through 'grails run-war' (or on a standalone Tomcat) it does not. I don't see any obvious error in the logs and the app is deployed correctly, as Spring Security is redirecting me to the login page, as expected. My login page, however, doesn't render properly, as it clearly isn't applying my template.
I'm not very familiar with grails-core, but looking in GrailsLayoutDecoratorMapper it appear that it looks for the layout in:
1. /WEB-INF/grails-app/views/layouts/[NAME].gsp
2. /WEB-INF/plugins/myplugin/grails-app/views/layouts/[NAME].gsp
3. /WEB-INF/plugins/*/grails-app/views/layouts/[NAME].gsp
Case 1 doesn't apply as the layout exists only in the plugin. Case 2 & 3 don't find anything, since when I expand my war I can't see a directory under /WEB-INF/plugins for any plugin I have declared in BuildConfig.
My workaround has been to redeploy my layout plugin with the default org.grails.plugins group and install the old-fashioned way:
1. Removed the groupId specification from my plugin descriptor.
2. Repolyed to the Maven repo under the org.grails.plugin group.
3. Removed the plugin dependency in BuildConfig.groovy from my host app.
4. Installed the plugin using 'grails install-plugin mylayoutplugin', so that it was installed in application.properties and not BuildConfig.groovy.
Am I missing anything or is this a bug?
Thanks,
Martin Dow.
May be a bug, please attach an example that reproduces the problem