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 35 public class HelloAction extends ServiceableAction implements ThreadSafe { 36 37 41 public Map act (Redirector redirector, SourceResolver resolver, Map objectModel, String src, Parameters par) throws Exception { 42 Request request = ObjectModelHelper.getRequest(objectModel); 43 if (request != null) { 44 Session session = request.getSession (false); 45 46 if (session != null) { 47 if (session.isNew()) { 48 getLogger().debug("Session is new"); 49 } else { 50 getLogger().debug("Session is old"); 51 } 52 } else { 53 getLogger().debug("A session object was not created"); 54 } 55 } 56 57 return null; 58 } 59 } 60 61 62 63 | Popular Tags |