1 6 7 package sessionViewer; 8 9 import com.lutris.appserver.server.*; 10 import com.lutris.appserver.server.httpPresentation.*; 11 import com.lutris.appserver.server.session.*; 12 import com.lutris.util.*; 13 14 import com.lutris.http.BasicAuth; 15 import com.lutris.http.BasicAuthResult; 16 import sessionViewer.spec.*; 17 22 public class SessionViewer extends StandardApplication { 23 24 25 private String relm = "SessionViewer"; 29 30 31 32 public static String refresh = "0"; 33 37 public void startup(Config appConfig) throws ApplicationException { 38 39 super.startup(appConfig); 40 try { 41 refresh = appConfig.getString("SessionViewer.Refresh"); 42 Integer.parseInt(refresh); 43 } catch (Exception ex){ 44 refresh = "0"; 45 } 46 47 } 48 49 public boolean requestPreprocessor(HttpPresentationComms comms) 50 throws Exception { 51 super.requestPreprocessor(comms); 52 if (comms.session == null) { 53 return false; 55 } 56 57 62 74 75 String user = comms.request.getRemoteUser(); 76 77 if(user!=null) 78 { 79 if (comms.session.getUser() == null) 80 { 81 SessionViewerUser enhydraUser = new SessionViewerUser(user); 82 comms.session.setUser(enhydraUser); 83 84 } 85 } 86 87 return false; 89 } 90 91 92 100 public String toHtml() { 101 return "This is <I>SessionViewer</I>"; 102 } 103 } 104 105 | Popular Tags |