In Spring Boot 2.0 (spring-session-core-2.0.2), how to replace the changed session-related class.

Asked 2 years ago, Updated 2 years ago, 191 views

In spring-session-core-2.0.2, the following sources that existed in the previous version are
Alternate sources that are missing but will replace these sources,
Also, I don't know how to implement the replacement, so
I would appreciate your advice and guidance.

· org.springframework.session.web.http.HttpSessionStratey.java
· org.springframework.session.ExpiringSession.java

Thank you for your cooperation.


In spring-session-core-2.0.2, the following sources that exist in the previous version
Altough lost, alternative sources to replace these sources,
Since the replacement mounting method is unknown,
I would have been if you could give me advice and guidance.

·Org.springframework.session.web.http.HttpSessionStratey.java
· Org.springframework.session.ExpiringSession.java

Thank you.

[Additional note]

>Dear TAKUMA, Thank you for your reply.
I will check and refer to it, and I will add the results of the correspondence at a later date.

Also, the following was omitted from the question.
Let me add it.

· org.springframework.session.SessionRepository.java

The getSession method, which existed in the previous version, has disappeared as well.
I looked for an alternative source and method, but I was not sure. If you have any clues, could you please let me know?

spring-boot session

2022-09-30 21:28

1 Answers

Looking at the commit history, it seems that HttpSessionStratey has been renamed HttpSessionIdResolver.

https://github.com/spring-projects/spring-session/commit/6f05c84aa7c1f7c4efcf2c0d3c20709a79b0785f

ExpiringSession seems to have migrated the method into the Session class.

https://github.com/spring-projects/spring-session/commit/4cf26d9c361f3f5d70dbf06dbb0826f8d2735f31

So basically, it would be OK to change it as follows.

org.springframework.session.web.http.HttpSessionStrateyorg.springframework.session.session.web.http.HttpSessionIdResolver
org.springframework.session.ExpiringSessionorg.springframework.session.session

add

Regarding additional questions, getSession has changed the method name to findById in the commit below.

https://github.com/spring-projects/spring-session/commit/0127ef9f9bf4a4a41f83092022e1ab81e61a86db#diff-c0f7eef08416729ad4291ae9a7e6e6e3


2022-09-30 21:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.