-
Bug
-
Resolution: Fixed
-
Major
-
4.0
I encountered a bug when using tags (of the Tag sort, SimpleTags work fine) in paragraph templates. Somehow the writer of the pageContext gets lost, and freemarker does not like it: from TagTransformModel:
if(out instanceof JspWriter) { if(out != pageContext.getOut()) { throw new TemplateModelException( "out != pageContext.getOut(). Out is " + out + " pageContext.getOut() is " + pageContext.getOut()); } usesAdapter = false; } else { out = new JspWriterAdapter(out); // etc...
There are multiple approaches:
- currently, the include tag passes the pageContext.getOut to the paragraph renderer. This trigger the if block above. Include tag could wrap the JspWriter in a regular writer. This is how I fixed it with r18328
- fixing freemarker by omiting this if block - I'll contact the developers to try and understand what the reasoning is
- figure out a way to not loose the pageContext/writer when rendering paragraphs. I'm pretty unsure how that happens as of now.
Acceptance criteria
- is related to
-
MAGNOLIA-2010 WebContextImpl.include() should use pageContext if available
- Closed
-
MAGNOLIA-923 allow use of jsp tags in freemarker templates
- Closed
-
MAGNOLIA-2186 Provide support for freemarker (page) templates
- Closed
-
MAGNOLIA-1646 Makes jsp pageContext available in WebContext for use in paragraph renderers
- Closed