1 18 19 package org.apache.struts.actions; 20 21 import javax.servlet.ServletException ; 22 import javax.servlet.http.HttpServletRequest ; 23 import javax.servlet.http.HttpServletResponse ; 24 25 import org.apache.struts.action.Action; 26 import org.apache.struts.action.ActionForm; 27 import org.apache.struts.action.ActionForward; 28 import org.apache.struts.action.ActionMapping; 29 import org.apache.struts.util.MessageResources; 30 31 56 public class ForwardAction extends Action { 57 58 59 61 62 65 protected static MessageResources messages = 66 MessageResources.getMessageResources 67 ("org.apache.struts.actions.LocalStrings"); 68 69 70 72 73 87 public ActionForward execute( 88 ActionMapping mapping, 89 ActionForm form, 90 HttpServletRequest request, 91 HttpServletResponse response) 92 throws Exception { 93 94 String path = mapping.getParameter(); 96 97 if (path == null) { 98 throw new ServletException (messages.getMessage("forward.path")); 99 } 100 101 ActionForward retVal = new ActionForward(path); 103 retVal.setContextRelative(true); 104 105 return retVal; 106 } 107 108 109 } 110 111 | Popular Tags |