I would like to create my own custom scope bean which will use HTTP session (kind of Flash scope).
According to Spring Manual I need to implement org.springframewor
You can get access to session attributes using the next code within your scope class methods in Spring MVC (works in 3.2):
RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
attributes.getAttribute("some key", NativeWebRequest.SCOPE_SESSION);
attributes.setAttribute("some key", YouObject, NativeWebRequest.SCOPE_SESSION);
RequestAttributes implementation (ServletRequestAttributes) internally will call set/getAttribute() methods on current session object.