Commits

Anonymous committed 44fedcc

WW-1437
ShowCase problem with sessionInvalidation feature

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2879573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (1)

webapps/showcase/src/java/com/opensymphony/webwork/showcase/sessionInvalidation/SessionInvalidationAction.java

 
 import java.util.Map;
 
+import javax.servlet.http.HttpSession;
+
+import com.opensymphony.webwork.ServletActionContext;
 import com.opensymphony.webwork.interceptor.SessionAware;
 import com.opensymphony.xwork.ActionSupport;
 
  * @author tmjee
  * @version $Date$ $Id$
  */
-public class SessionInvalidationAction extends ActionSupport implements SessionAware {
-
+public class SessionInvalidationAction extends ActionSupport /*implements SessionAware*/ {
+// NOTE: SessionAware was not being used due to quickstart not being able to compile, 
+//       complaining that the abstract method setSession(Map) method from SessionAware
+//       interface is not being implemented whereas in fact it is. It seems to be ok 
+//       if the war file was deployed standalone in Tomcat, just that in quickstart
+//       it seems to be an issue. Since quickstart is doing hot deployment, it might
+//       have something to do with that, or how quickstart hot deploy java class file
+//       (not sure). (WW-1437)
+	
 	private Map sessionMap;
 	
 	private static final long serialVersionUID = -2634727929107900849L;
 
 	public String start() throws Exception {
-		// sessionMap.remove("___invalidateSession");
-		sessionMap.put("someKey1", "someValue1");
-		sessionMap.put("someKey2",	"someValue2");
+		
+		HttpSession session = ServletActionContext.getRequest().getSession(true);
+		
+		//sessionMap.put("someKey1", "someValue1");
+		//sessionMap.put("someKey2",	"someValue2");
+		
+		session.setAttribute("someKey1", "someValue1");
+		session.setAttribute("someKey2", "someValue2");
+		
 		return SUCCESS;
 	}
 	
 		return SUCCESS;
 	}
 
-	public void setSession(Map session) {
+	/*public void setSession(Map session) {
 		this.sessionMap = session;
-	}
+	}*/
 	
 }