Session Management in Struts2 using Session Aware Interface
Session Management in Struts2 using Session Aware Interface Session Management in Struts2 can be done in many ways. One of the ways is to implement the Session Aware Interface. Let us look at a sample login application that uses the Session Aware Interface. Step-1: Create a LoginAction class that implements a SessionAware Interface. Session Aware interface is available as a part of – interceptor package org.apache.struts2.interceptor.SessionAware . Implement the setSession() method which is an abstract method of SessionAware Interface package com.anjana.struts2; import com.opensymphony.xwork2.ActionSupport; import org.apache.struts2.interceptor.SessionAware; import java.util.Map; public class Login extends ActionSupport implements SessionAware { private static final long serialVersionUID = 1L; private String userName; private String password; private String variableValue = "ffddf"; private Map sessionObj; public Login() { } public String execute...