I\'m trying to add a Filter that creates an object that is then to be used inside a controller in a Spring Boot application.
The idea is to use the Filter as a \"cen
Why Don't you use a Bean with the @Scope('request')
@Component
@Scope(value="request", proxyMode= ScopedProxyMode.TARGET_CLASS)
class UserInfo {
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
private String password;
}
and then you can Autowireed
this bean in both filter and controller to do setting and getting of data.
lifecycle of this UserInfo
bean is only exisits within the request so once the http request is done then it terminates the instance as well