How to set attribute name in spring session bean scope?

A spring bean is set that is configured with a session scope, for example:

@Component @Scope(proxyMode=ScopedProxyMode.TARGET_CLASS,value=WebApplicationContext.SCOPE_SESSION) public class SomeBean { } 

Is there a way to control the name that spring will store the bean in the http session?

By default, spring stitches use the session key scopedTarget.someBean is there anything I can add to the annotations to explicitly specify the attribute name in the session?

+6
source share
1 answer

I would use:

 @Component (value="mySpecialName") @Scope (value="session") 
+3
source

Source: https://habr.com/ru/post/915627/


All Articles