spring-projects / spring-projects/spring-session

Serialized session losing property editors

Open
#331 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage
Dominant language
Java
Stars
1.9k
Forks
1.2k
Avg merge
4h 27m
Merged PRs (30d)
55

Description

We have a @Controller that uses @InitBinder to register a custom property editor. When there are data binding errors the BeanPropertyBindingResult is saved to the session in Spring's flash map but the BeanWrapper containing the property editors is transient, causing errors when values are retrieved and not converted properly.

There are some issues relating to this, https://jira.spring.io/browse/SPR-2569 and https://jira.spring.io/browse/SPR-2674, that suggest property editors should be re-applied after the binding result has been retrieved from the session. Is there a way to do this at the application level or would this need a pull request for spring-session?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how BeanPropertyBindingResult is stored in and retrieved from Spring's flash map, focusing on the transient BeanWrapper and the @InitBinder entry point. Check the linked SPR-2569 and SPR-2674 issues for expected behavior; done means the handling of custom property editors after session retrieval is clearly established and covered by the relevant project tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.