1 18 19 package org.apache.struts.tiles; 20 21 import java.io.IOException ; 22 23 import javax.servlet.ServletContext ; 24 import javax.servlet.ServletException ; 25 import javax.servlet.http.HttpServletRequest ; 26 import javax.servlet.http.HttpServletResponse ; 27 28 import org.apache.struts.action.Action; 29 30 34 public class ActionController implements Controller { 35 36 39 private Action action = null; 40 41 45 public ActionController(Action action) { 46 this.action = action; 47 } 48 49 59 public void perform( 60 ComponentContext tileContext, 61 HttpServletRequest request, 62 HttpServletResponse response, 63 ServletContext servletContext) 64 throws ServletException , IOException { 65 66 try { 67 action.execute(null, null, request, response); 68 69 } catch (Exception e) { 70 throw new ServletException (e); 71 } 72 } 73 74 77 public void execute( 78 ComponentContext tileContext, 79 HttpServletRequest request, 80 HttpServletResponse response, 81 ServletContext servletContext) 82 throws Exception { 83 84 this.action.execute(null, null, request, response); 85 86 } 87 } 88 | Popular Tags |