Skip to content

Invalid reference to RequestParameters in Freemarker after upgrade #34733

Closed as not planned
@anabright

Description

@anabright

I just upgraded my app to Spring Boot 3.0.5 and there seems to be something broken with spring-boot-starter-freemarker.

In my Freemarker template, I have this line that used to work before the upgrade:

<div>${RequestParameters.myParam!}</div>

After the upgrade, I get this error when loading the template:

freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> RequestParameters  [in template "template.ftlh" at line 136, column 11]

----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: ${RequestParameters.myParam!}  [in template "template.ftlh" at line 136, column 9]

It seems like RequestParameters is not available anymore.

Is there a fix in sight for this?
Any workarounds?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixstatus: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions