1 16 package org.apache.cocoon.acting; 17 18 import org.apache.avalon.framework.parameters.Parameters; 19 import org.apache.avalon.framework.thread.ThreadSafe; 20 import org.apache.cocoon.environment.ObjectModelHelper; 21 import org.apache.cocoon.environment.Redirector; 22 import org.apache.cocoon.environment.Request; 23 import org.apache.cocoon.environment.Session; 24 import org.apache.cocoon.environment.SourceResolver; 25 26 import java.util.Map ; 27 28 29 36 public class SessionIsValidAction extends AbstractAction implements ThreadSafe 37 { 38 41 public Map act (Redirector redirector, SourceResolver resolver, Map objectModel, String src, 42 Parameters parameters) throws Exception { 43 Request req = ObjectModelHelper.getRequest(objectModel); 44 45 46 Session session = req.getSession (false); 47 if (session == null) { 48 if (this.getLogger().isDebugEnabled()) { 49 getLogger().debug("No session object"); 50 } 51 return null; 52 } 53 if (!req.isRequestedSessionIdValid()) { 54 if (this.getLogger().isDebugEnabled()) { 55 getLogger().debug("Requested session id is invalid"); 56 } 57 return null; 58 } 59 60 return EMPTY_MAP; 61 } 62 } 63 | Popular Tags |