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