Dependency Injection in Struts2 Accessing Session Scoped Beans

Let’s start from looking what is a Scope.Strategy by looking at the docs. It says Pluggable scoping strategy. Enables users to provide custom implementations of request, session, and wizard scopes. Implement and pass to Container.setScopeStrategy(com.opensymphony.xwork2.inject.Scope.Strategy) Ok, assume I want to implement session scope. Then I need to know the place where I could implement it. … Read more

How to invalidate session in JSF 2.0?

Firstly, is this method correct? Is there a way without touching the ServletAPI? You can use ExternalContext#invalidateSession() to invalidate the session without the need to grab the Servlet API. @ManagedBean @SessionScoped public class UserManager { private User current; public String logout() { FacesContext.getCurrentInstance().getExternalContext().invalidateSession(); return “/home.xhtml?faces-redirect=true”; } // … } what will happen to my current … Read more