Denied Access in Freemarker TemplateDenied Access in Freemarker Templatehttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1212932272024-03-28T22:46:13Z2024-03-28T22:46:13ZRE: Denied Access in Freemarker TemplateOlaf Kockhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1212968062021-12-14T07:59:12Z2021-12-14T07:59:12Z<p>Q1: Which version?<br /> Q2: Did you compare both
installations' configuration? E.g. Template classes can (and should)
be denied access to most of the underlying runtime environment, and
I'd rather consider this a feature than a problem</p>
<p>General Statement: A freemarker template should not contain any code
like this at all. It's meant to create the UI, not store arbitrary
stuff in sessions (in fact, <em>nothing</em> should be stored there
ever - it hinders load-balancer-fail-overs, eats up your memory, and
makes your code unmaintainable)</p>Olaf Kock2021-12-14T07:59:12ZDenied Access in Freemarker TemplateMohamed Saleemhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1212932262021-12-13T18:04:15Z2021-12-10T09:57:26Z<p>Hi, </p>
<p>I am using request.getSession() in freemarker template to set some
attribute , It is working in Dev Environment</p>
<p>In QA and Prod It is throwing Errror </p>
<p> </p>
<p>
<strong>Example,</strong></p>
<p>${request.getSession().setAttribute("title", "Title")}</p>
<p>
<strong>Below Error I am getting</strong></p>
<p>Denied access to method or field setAttribute of class org.apache.catalina.session.StandardSessionFacade</p>
<p>----<br /> FTL stack trace ("~" means
nesting-related):<br /> - Failed at:
${request.getSession().setAttribute(t... [in template
"34393807#34393846#null" at line 59, column 9]</p>
<p> </p>
<p>If any one knows p