Using CDI Injection in a Servlet
问题 I am attempting to @Inject a @SessionScoped bean into a Filter @WebFilter("/*") public class IdentityFilter implements Filter, Serializable { @Inject private LoginUser loginUser; ... where LoginUser is @SessionScoped The intention is for loginUser to represent the logged in user for the session. The problem is it appears that I am not always getting the loginUser from the current session, I am getting 'leakage' between sessions as one session's LoginUser object is being shared with another