KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > turbine > services > pull > tools > TemplateLinkWithSlash


1 package org.apache.turbine.services.pull.tools;
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.pull.ApplicationTool;
20
21 /**
22  * This class allows one to specify paths in the setPage method
23  * using '/' slash as opposed to the ',' used in TemplateLink.
24  * It is less efficient as the '/' are converted to ',' to avoid
25  * problems parsing the pathinfo after conversion in a web server.
26  *
27  * It is recommended that projects standardize on using the ','
28  * separator and use TemplateLink. But this class is available for
29  * those who do not mind the inefficiency.
30  *
31  * <p>
32  *
33  * This is an application pull tool for the template system. You should <b>not</b>
34  * use it in a normal application!
35  *
36  * @deprecated Use {@link org.apache.turbine.services.pull.tools.TemplateLink} instead and fix up your template references.
37  *
38  * @author <a HREF="jmcnally@collab.net">John D. McNally</a>
39  * @version $Id: TemplateLinkWithSlash.java,v 1.3.2.2 2004/05/20 03:06:51 seade Exp $
40  */

41 public class TemplateLinkWithSlash
42     extends TemplateLink
43     implements ApplicationTool
44
45 {
46     /**
47      * Default constructor
48      * <p>
49      * The init method must be called before use.
50      */

51     public TemplateLinkWithSlash()
52     {
53         super();
54     }
55     
56     /**
57      * Sets the template variable used by the Template Service.
58      * This method allows slashes '/' as the path separator.
59      *
60      * @param t A String with the template name.
61      * @return A TemplateLink.
62      */

63     public TemplateLink setPage(String JavaDoc template)
64     {
65         super.setPage( template.replace('/', ',') );
66         return this;
67     }
68 }
69
70
71
Popular Tags