1 19 20 package com.sslexplorer.navigation.actions; 21 22 import javax.servlet.http.HttpServletRequest ; 23 import javax.servlet.http.HttpServletResponse ; 24 25 import org.apache.struts.action.ActionForm; 26 import org.apache.struts.action.ActionForward; 27 import org.apache.struts.action.ActionMapping; 28 29 import com.sslexplorer.core.CoreUtil; 30 import com.sslexplorer.core.FileDownloadPageInterceptListener; 31 import com.sslexplorer.core.RedirectWithMessages; 32 import com.sslexplorer.core.actions.AuthenticatedAction; 33 import com.sslexplorer.security.Constants; 34 import com.sslexplorer.security.SessionInfo; 35 36 37 43 public class ShowHomeAction extends AuthenticatedAction { 44 48 public ShowHomeAction() { 49 super(); 50 } 51 52 55 protected ActionForward onExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { 56 57 60 SessionInfo info = this.getSessionInfo(request); 61 CoreUtil.clearFlow(request); 62 CoreUtil.removePageInterceptListener(request.getSession(), FileDownloadPageInterceptListener.INTERCEPT_ID); 63 64 66 switch(info.getNavigationContext()) { 67 case SessionInfo.MANAGEMENT_CONSOLE_CONTEXT: 68 return new RedirectWithMessages(mapping.findForward("managementConsole"), request); 69 } 70 return new RedirectWithMessages(mapping.findForward("userConsole"), request); 71 } 72 73 76 public int getNavigationContext(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { 77 return SessionInfo.MANAGEMENT_CONSOLE_CONTEXT | SessionInfo.USER_CONSOLE_CONTEXT; 78 } 79 } 80 | Popular Tags |