KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > turbine > services > jsp > JspService


1 package org.apache.turbine.services.jsp;
2
3 /*
4  * Copyright 2001-2004 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License")
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 import org.apache.turbine.services.Service;
20
21 import org.apache.turbine.util.RunData;
22 import org.apache.turbine.util.TurbineException;
23
24
25 /**
26  * Implementations of the JspService interface.
27  *
28  * @author <a HREF="mailto:john.mcnally@clearink.com">John D. McNally</a>
29  * @version $Id: JspService.java,v 1.7.2.2 2004/05/20 03:06:52 seade Exp $
30  */

31 public interface JspService
32     extends Service
33 {
34     /** The name used to specify this service in Turbine.properties */
35     String JavaDoc SERVICE_NAME = "JspService";
36
37     /** The key used to store an instance of RunData in the request */
38     String JavaDoc RUNDATA = "rundata";
39
40     /** The key used to store an instance of JspLink in the request */
41     String JavaDoc LINK = "link";
42
43     /** The default extension of JSPs */
44     String JavaDoc JSP_EXTENSION = "jsp";
45
46     /** Property key for Template Pathes */
47     String JavaDoc TEMPLATE_PATH_KEY = "templates";
48
49     /** Property for Jsp Page Buffer Size */
50     String JavaDoc BUFFER_SIZE_KEY = "buffer.size";
51
52     /** Default Value for Jsp Page Buffer Size */
53     int BUFFER_SIZE_DEFAULT = 8192;
54
55     /**
56      * Adds some convenience objects to the request. For example an instance
57      * of JspLink which can be used to generate links to other templates.
58      *
59      * @param data the turbine rundata object
60      */

61     void addDefaultObjects(RunData data);
62
63     /**
64      * executes the JSP given by templateName.
65      *
66      * @param data A RunData Object
67      * @param templateName The template to execute
68      * @param isForward whether to perform a forward or include.
69      *
70      * @throws TurbineException If a problem occured while executing the JSP
71      */

72     void handleRequest(RunData data, String JavaDoc templateName, boolean isForward)
73         throws TurbineException;
74
75     /**
76      * executes the JSP given by templateName.
77      *
78      * @param data A RunData Object
79      * @param templateName The template to execute
80      *
81      * @throws TurbineException If a problem occured while executing the JSP
82      */

83     void handleRequest(RunData data, String JavaDoc templateName)
84         throws TurbineException;
85
86     /**
87      * Returns the default buffer size of the JspService
88      *
89      * @return The default buffer size.
90      */

91     int getDefaultBufferSize();
92
93     /**
94      * Searchs for a template in the default.template path[s] and
95      * returns the template name with a relative path which is required
96      * by <a HREF="http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html#getRequestDispatcher(java.lang.String)">javax.servlet.RequestDispatcher</a>
97      *
98      * @param template The name of the template to search for.
99      *
100      * @return the template with a relative path
101      */

102     String JavaDoc getRelativeTemplateName(String JavaDoc template);
103
104 }
105
Popular Tags