Spring Boot 3 is not working with Freemarker JSPTagLib.

<#assign security=JspTaglibs["http://www.springframework.org/security/tags"]/>

<@security.authorize access="isAuthenticated()">
    <@security.authentication property="principal.username"/>
</@security.authorize>

For Spring Boot 2 also had similar issue I have used workaround & that was working. Referred: https://vorba.ch/2018/spring-boot-freemarker-security-jsp-taglib.html

Now I am upgrading to Spring Boot 3 But that workaround not working anymore. TagLibFactory removed from FreeMarkerConfigurer

freeMarkerConfigurer.getTaglibFactory().setClasspathTlds(…);

Could you please suggest proper way or if I can still do some workaround to execute my stuff. Thanks

Comment From: wilkinsona

Unfortunately, I don't think this is possible as FreeMarker does not support Jakarta EE 9 which is the baseline for Spring Boot 3.x and Spring Framework 6.x. It is for this reason that the getTaglibFactory() method was removed. If you want to continue to use FreeMarker with Spring Boot 3.x, you will have to avoid using any Servlet- and JSP-related features until FREEMARKER-218 has been implemented.

Comment From: marc-anton

About https://issues.apache.org/jira/browse/FREEMARKER-218 ... Is there already a release date planned for the version 2.3.33, which should fix the problem with "JspTaglibs" and Spring Boot 3 ?

Comment From: wilkinsona

I'm not sure if you're asking when Boot will upgrade to Freemarker 2.3.33 or when Freemarker 2.3.33 will be released. The latter is a question for the Freemarker team as it's out of our control. The former is also out of our control until the Freemarker release has happened. Once it has, we're likely to upgrade in the following round of Spring Boot maintenance releases.

Comment From: snicoll

FTR this has been addressed in Spring Framework 6.2 due this fall, see https://github.com/spring-projects/spring-framework/issues/30186.