1 18 19 package org.apache.struts.faces.systest1; 20 21 import java.util.Locale ; 22 import javax.servlet.http.HttpServletRequest ; 23 import javax.servlet.http.HttpServletResponse ; 24 25 import org.apache.commons.logging.Log; 26 import org.apache.commons.logging.LogFactory; 27 28 import org.apache.struts.action.Action; 29 import org.apache.struts.action.ActionForm; 30 import org.apache.struts.action.ActionForward; 31 import org.apache.struts.action.ActionMapping; 32 import org.apache.struts.action.ActionError; 33 import org.apache.struts.action.ActionErrors; 34 35 36 40 41 public class ContextAction extends Action { 42 43 44 private static final Log log = LogFactory.getLog(ContextAction.class); 45 46 47 private String authType = null; 48 private String contextPath = null; 49 private Locale locale = null; 50 private String pathInfo = null; 51 private String remoteUser = null; 52 private String servletPath = null; 53 54 55 public String getAuthType() { return (this.authType); } 56 public String getContextPath() { return (this.contextPath); } 57 public Locale getLocale() { return (this.locale); } 58 public String getPathInfo() { return (this.pathInfo); } 59 public String getRemoteUser() { return (this.remoteUser); } 60 public String getServletPath() { return (this.servletPath); } 61 62 63 66 public ActionForward execute(ActionMapping mapping, 67 ActionForm form, 68 HttpServletRequest request, 69 HttpServletResponse response) 70 throws Exception { 71 72 this.authType = request.getAuthType(); 73 this.contextPath = request.getContextPath(); 74 this.locale = request.getLocale(); 75 this.pathInfo = request.getPathInfo(); 76 this.remoteUser = request.getRemoteUser(); 77 this.servletPath = request.getServletPath(); 78 79 request.setAttribute("contextAction", this); 80 return (mapping.findForward("context1")); 81 82 } 83 84 85 } 86 | Popular Tags |