1 package org.apache.turbine.services.jsp;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.turbine.services.Service;
23
24 import org.apache.turbine.util.RunData;
25 import org.apache.turbine.util.TurbineException;
26
27
28 /***
29 * Implementations of the JspService interface.
30 *
31 * @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
32 * @version $Id: JspService.java 534527 2007-05-02 16:10:59Z tv $
33 */
34 public interface JspService
35 extends Service
36 {
37 /*** The name used to specify this service in Turbine.properties */
38 String SERVICE_NAME = "JspService";
39
40 /*** The key used to store an instance of RunData in the request */
41 String RUNDATA = "rundata";
42
43 /*** The key used to store an instance of JspLink in the request */
44 String LINK = "link";
45
46 /*** The default extension of JSPs */
47 String JSP_EXTENSION = "jsp";
48
49 /*** Property key for Template Pathes */
50 String TEMPLATE_PATH_KEY = "templates";
51
52 /*** Property for Jsp Page Buffer Size */
53 String BUFFER_SIZE_KEY = "buffer.size";
54
55 /*** Default Value for Jsp Page Buffer Size */
56 int BUFFER_SIZE_DEFAULT = 8192;
57
58 /***
59 * Adds some convenience objects to the request. For example an instance
60 * of JspLink which can be used to generate links to other templates.
61 *
62 * @param data the turbine rundata object
63 */
64 void addDefaultObjects(RunData data);
65
66 /***
67 * executes the JSP given by templateName.
68 *
69 * @param data A RunData Object
70 * @param templateName The template to execute
71 * @param isForward whether to perform a forward or include.
72 *
73 * @throws TurbineException If a problem occured while executing the JSP
74 */
75 void handleRequest(RunData data, String templateName, boolean isForward)
76 throws TurbineException;
77
78 /***
79 * executes the JSP given by templateName.
80 *
81 * @param data A RunData Object
82 * @param templateName The template to execute
83 *
84 * @throws TurbineException If a problem occured while executing the JSP
85 */
86 void handleRequest(RunData data, String templateName)
87 throws TurbineException;
88
89 /***
90 * Returns the default buffer size of the JspService
91 *
92 * @return The default buffer size.
93 */
94 int getDefaultBufferSize();
95
96 /***
97 * Searchs for a template in the default.template path[s] and
98 * returns the template name with a relative path which is required
99 * by <a href="http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html#getRequestDispatcher(java.lang.String)">javax.servlet.RequestDispatcher</a>
100 *
101 * @param template The name of the template to search for.
102 *
103 * @return the template with a relative path
104 */
105 String getRelativeTemplateName(String template);
106
107 }