Dependency Injection in Struts2 Accessing Session Scoped Beans
Recently I needed to use DI in Struts2. I know it uses it's own DI implementation like Guice but not Guice, as far as I couldn't find some annotations suitable to set the scope for injected beans. To be short, I created a bean //@Repository //@Scope("session") public class Session { private Map<String, Object> map = new HashMap<>(); public Map<String, Object> getMap() { return map; } public void setMap(Map<String, Object> map) { this.map = map; } } I have commented the annotations used with Spring beans. I was successfully created the same bean via spring DI and set the scope in which my