Hi guys, I tried folding sitemesh in filter only into gaelyk as a precursor to knowing how it might fold into grails. "Not working" really helps focus one's understanding :-) Must say I was surprised to find java.util.logging being used instead of slf4j (which seems the industry standard now), but that aside - gaelyk has the controller servlet forward to the view servlet and this seems to cause sitemesh to fail to process the request. I put some of my own logging in, and found that the "should i buffer" is being asked twice, but haven't yet figured out what the problem is. I do prefer the mechanism grails uses to specify the decorator (the element in the head tag at the top), so I am going to need to delve a bit deeper into understanding how it all fits together in any case. Richard
Hi guys, I tried folding sitemesh in filter only into gaelyk as a precursor to knowing how it might fold into grails. "Not working" really helps focus one's understanding :-)
Must say I was surprised to find java.util.logging being used instead of slf4j (which seems the industry standard now),
but that aside - gaelyk has the controller servlet forward to the view servlet and this seems to cause sitemesh to fail to process the request. I put some of my own logging in, and found that the "should i buffer" is being asked twice, but haven't yet figured out what the problem is.
I do prefer the mechanism grails uses to specify the decorator (the element in the head tag at the top), so I am going to need to delve a bit deeper into understanding how it all fits together in any case.
but that aside - gaelyk has the controller servlet forward to the view servlet and this seems to cause sitemesh to fail to process the request. I put some of my own logging in, and found that the "should i buffer" is being asked twice, but haven't yet figured out what the problem is.So, is the problem caused when a servlet dispatches to another servlet?I can create a test for this and have a go at fixing (unless you're already on the case).
I do prefer the mechanism grails uses to specify the decorator (the element in the head tag at the top), so I am going to need to delve a bit deeper into understanding how it all fits together in any case.SM3 has the extension points to do this. At the moment, you have to write some code, but I'd like this to work out of the box before the final release - now would be a good opportunity to get your name in the code ;)Here's the approach:1. Define a custom TagRuleBundle (used by the ContentProcessor) that will extract the decorator name from the markup and add it as a property to the Content model.If you are getting this from the <meta> tag, you don't need to do anything as the default (CoreHtmlTagRuleBundle) already extracts <meta> tags.2. Define a custom DecoratorSelector implementation, that reads the property from the Content model and tells SM to use that as the decorator.3. Install the TagRuleBundle and DecoratorSelector by adding them to SiteMeshBuilder.