Skip to content

RequestContextListener with Spring Session #129

@cemo

Description

@cemo

We need to access some session bean scope beans but this is causing an error in our side. Since org.springframework.web.context.request.RequestContextListener is setting Request very early, Accessing a SessionScope bean is throwing an exception. org.springframework.web.context.request.RequestContextHolder must be set after wrapping Request by SessionRepository.

Using org.springframework.web.filter.RequestContextFilter instead of org.springframework.web.context.request.RequestContextListener is a solution but this is not common practice. For example even Spring Boot is using RequestContextListener.

It seems that RequestContextListener should not be used with Spring Session. What do you think?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions