1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.apache.struts.tiles;
23
24 import java.io.IOException;
25
26 import javax.servlet.ServletContext;
27 import javax.servlet.ServletException;
28 import javax.servlet.http.HttpServletRequest;
29 import javax.servlet.http.HttpServletResponse;
30
31 /**
32 * A controller is a piece of code called before rendering a jsp page.
33 * A controller can be associated to a tile. See <insert> or
34 * <definition> for association syntax.
35 */
36 public interface Controller {
37
38 /**
39 * Method associated to a tile and called immediately before the tile
40 * is included.
41 *
42 * @param tileContext Current tile context.
43 * @param request Current request
44 * @param response Current response
45 * @param servletContext Current servlet context
46 * @deprecated Use execute() instead. This will be removed after
47 * Struts 1.2.
48 */
49 public void perform(
50 ComponentContext tileContext,
51 HttpServletRequest request,
52 HttpServletResponse response,
53 ServletContext servletContext)
54 throws ServletException, IOException;
55
56 /**
57 * Method associated to a tile and called immediately before the tile
58 * is included.
59 *
60 * @param tileContext Current tile context.
61 * @param request Current request
62 * @param response Current response
63 * @param servletContext Current servlet context
64 */
65 public void execute(
66 ComponentContext tileContext,
67 HttpServletRequest request,
68 HttpServletResponse response,
69 ServletContext servletContext)
70 throws Exception;
71 }