You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say I have a grails app, that's working. Great. But then let's say I convert that app to a plugin for use in other apps. It probably won't work, because grails seems to search for layouts in plugins randomly. So let's say your main app doesn't have a layouts/main.gsp, so you're expecting that when you call a web page in your plugin, the plugin should pick up its own layouts/main.gsp, but it doesn't. Instead it seems to pick up a layouts/main.gsp from a random plugin, which is highly likely to be the boilerplate "Welcome to grails" crap, that a lot of plugin writers have just left lying around in their code.
Now you might say, well don't call your layout "main", which is fair, however:
We had a situation where it was working fine running as a jar, but not running correctly in Tomcat, seemingly because in one case it randomly picked correctly, and the other time it randomly did not pick correctly. This took an inordinate amount of effort and debugging to try and come to terms with what is going on.
People just go with the flow generally, which means there's a lot of plugins out there using main.gsp as their layout, because the template code does that. That means people are releasing plugins that may work for them, but may not work for you.
If you call it something else, it still might conflict with another plugin.
I would suggest that the correct order to search for layouts is (1) in the same plugin as the view (2) in the main application, (3) maybe alphabetically by plugin, or some other deterministic, albeit not very interesting order. Or even better, be able to specify a search order.
I realise a case could be made for swapping (1) and (2) above, and that's kinda the current way it works, but I would suggest that the order above will lead to the least unpleasant surprises, which is to search first in view's plugin, but there should be a config item so you can do it the other way.
It also wouldn't hurt if this report #10110 was implemented, and the template code specified what layout to apply.
Actual Behaviour
layout seems to be searched for randomly in plugins.
Steps To Reproduce
create plugin that has views and main.gsp layout.
embed plugin into top level grails app.
include a bunch of other plugins for good measure.
run the app and look at one of the views. There's a good chance it will pick up a different main.gsp layout than the one in the plugin that it relates to.
Environment Information
windows
java 17
Example Application
No response
Version
5.3.3
The text was updated successfully, but these errors were encountered:
Expected Behavior
Let's say I have a grails app, that's working. Great. But then let's say I convert that app to a plugin for use in other apps. It probably won't work, because grails seems to search for layouts in plugins randomly. So let's say your main app doesn't have a layouts/main.gsp, so you're expecting that when you call a web page in your plugin, the plugin should pick up its own layouts/main.gsp, but it doesn't. Instead it seems to pick up a layouts/main.gsp from a random plugin, which is highly likely to be the boilerplate "Welcome to grails" crap, that a lot of plugin writers have just left lying around in their code.
Now you might say, well don't call your layout "main", which is fair, however:
We had a situation where it was working fine running as a jar, but not running correctly in Tomcat, seemingly because in one case it randomly picked correctly, and the other time it randomly did not pick correctly. This took an inordinate amount of effort and debugging to try and come to terms with what is going on.
People just go with the flow generally, which means there's a lot of plugins out there using main.gsp as their layout, because the template code does that. That means people are releasing plugins that may work for them, but may not work for you.
If you call it something else, it still might conflict with another plugin.
I would suggest that the correct order to search for layouts is (1) in the same plugin as the view (2) in the main application, (3) maybe alphabetically by plugin, or some other deterministic, albeit not very interesting order. Or even better, be able to specify a search order.
I realise a case could be made for swapping (1) and (2) above, and that's kinda the current way it works, but I would suggest that the order above will lead to the least unpleasant surprises, which is to search first in view's plugin, but there should be a config item so you can do it the other way.
It also wouldn't hurt if this report #10110 was implemented, and the template code specified what layout to apply.
Actual Behaviour
layout seems to be searched for randomly in plugins.
Steps To Reproduce
Environment Information
windows
java 17
Example Application
No response
Version
5.3.3
The text was updated successfully, but these errors were encountered: