Skip to content

SpEL: Resolving values from Map works different after PropertyAccessor is cached [SPR-7614] #12270

@spring-projects-issues

Description

@spring-projects-issues

Gerrit Brehmer opened SPR-7614 and commented

I want to inject a single value of a request-url-parameter from JSF Faces Context: @Value("#{param.test}").

If I call the JSF-Page without this parameter first time, I get a SpEL exception:

EL1008E:(pos 6): Field or property 'test' cannot be found on object of type 'java.util.Collections$UnmodifiableMap'.

After that I make a valid call with 'test'-Parameter added and MapAccessor will be cached.

All calls after that valid call will not throw an exception. For missing parameter-requests, null value will be injected.

My expected behavior would be a null value, if the key doesn't exist in the map.

Is this possible?

I think the behavior between canRead (before caching) and read (after caching) is different for missing keys in the map.


Affects: 3.0.4

Referenced from: commits 1f1577e, 1933b64, 722778c

1 votes, 3 watchers

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions