[MAGNOLIA-3453] FreemarkerHelper does not expose Response object to freemarker Created: 07/Dec/10  Updated: 03/Jan/11  Resolved: 03/Jan/11

Status: Closed
Project: Magnolia
Component/s: freemarker
Affects Version/s: 4.4, 4.4.1
Fix Version/s: 4.4.2

Type: Bug Priority: Major
Reporter: Tobias Mattsson Assignee: Tobias Mattsson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
causality
relation
is related to MAGNOLIA-3338 Context is not updated on include req... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

FreemarkerHelper does not expose the response object to Freemarker. The addition of WebContext push/pop in Include.java (cms:includeTemplate) causes a push using null for response. This results in null pointer exceptions when transitioning from a freemarker template/paragraph to a JSP paragraph.



 Comments   
Comment by Tobias Mattsson [ 07/Dec/10 ]

became a problem after we added push/pop to Include.java

Comment by Philipp Bärfuss [ 08/Dec/10 ]

Isn't it now the better solution not to push/pop in the include tag as this is definitely the job ob the magnolia main filter.

Comment by Tobias Mattsson [ 08/Dec/10 ]

I think it makes sense to give the taglib extension of freemarker access to the response object. For the sake of consistency. It should also always be safe to do push/pop.

One situation where removing the push/pop will result in problems is when the customer have added a filter in web.xml that runs after MgnlMainFilter and adds wrappers to either request or response. When that filter is run in front of a JSP that then uses <cms:includeTemplate the added wrappers will be lost unless we do push/pop.

Generated at Mon Feb 12 03:46:38 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.