Skip to content
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

Automatically register HttpSessionIdListener beans with the servlet context #24879

Closed
mahairod opened this issue Jan 19, 2021 · 4 comments
Closed
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@mahairod
Copy link

mahairod commented Jan 19, 2021

At the present moment Spring Boot 2 does not handle automatic web listener registration. For this reason ServletListenerRegistrationBean is recommended to use. But this bean doesn't support relatively new HttpSessionIdListener (actually already legacy from spring boot's point of view) which is necessary to track session when using together with Spring security enabled. At the moment only these types of listeners are supported:

	types.add(ServletContextAttributeListener.class);
	types.add(ServletRequestListener.class);
	types.add(ServletRequestAttributeListener.class);
	types.add(HttpSessionAttributeListener.class);
	types.add(HttpSessionListener.class);
	types.add(ServletContextListener.class);

Also look here at the description of what listeners should be supported.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 19, 2021
@mahairod
Copy link
Author

mahairod commented Jan 19, 2021

Another approach would be make ServletListenerRegistrationBean class inheritable and extensible. Is there any reason why it is not?

@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Jan 19, 2021
@wilkinsona wilkinsona added this to the 2.5.x milestone Jan 19, 2021
@wilkinsona wilkinsona self-assigned this Jan 19, 2021
@wilkinsona wilkinsona modified the milestones: 2.5.x, 2.5.0-M1 Jan 19, 2021
@wilkinsona wilkinsona changed the title Add HttpSessionIdListener support to ServletListenerRegistrationBean Automatically register HttpSessionIdListener beans with the servlet context Jan 19, 2021
@werthdavid
Copy link

Does this "kill" Servlet 3.0 support? With Websphere 8.5 I can't get this running now due to these changes if I'm not wrong

@wilkinsona
Copy link
Member

We have required Servlet 3.1 since 2.0.x: #12370.

@werthdavid
Copy link

I see, my bad, I've missed that. In our scenario it has been working with Websphere 8.5 (servlet 3.0) until this change. Thanks for the reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

4 participants