Skip to content

Issue Spring Boot 3 with freemarker JSPTagLib #36280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
developershyam opened this issue Jul 7, 2023 · 4 comments
Closed

Issue Spring Boot 3 with freemarker JSPTagLib #36280

developershyam opened this issue Jul 7, 2023 · 4 comments
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid

Comments

@developershyam
Copy link

developershyam commented Jul 7, 2023

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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 7, 2023
@wilkinsona
Copy link
Member

wilkinsona commented Jul 7, 2023

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.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2023
@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 7, 2023
@marc-anton
Copy link

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 ?

@wilkinsona
Copy link
Member

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.

@snicoll
Copy link
Member

snicoll commented Jul 18, 2024

FTR this has been addressed in Spring Framework 6.2 due this fall, see spring-projects/spring-framework#30186.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

5 participants