View Javadoc

1   package org.apache.turbine.util.template;
2   
3   /*
4    * Copyright 2001-2005 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.util.RunData;
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   * <p>
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   * @author <a href="jmcnally@collab.net">John D. McNally</a>
32   * @version $Id: TemplateLinkWithSlash.java 264148 2005-08-29 14:21:04Z henning $
33   * @deprecated Use {@link org.apache.turbine.services.pull.tools.TemplateLinkWithSlash} instead.
34   */
35  public class TemplateLinkWithSlash
36          extends TemplateLink
37  {
38      /***
39       * Default constructor.
40       * <p>
41       * The init method must be called before use.
42       */
43      public TemplateLinkWithSlash()
44      {
45      }
46  
47      /***
48       * Constructor.
49       *
50       * @param data a Turbine RunData object.
51       */
52      public TemplateLinkWithSlash(RunData data)
53      {
54          super(data);
55      }
56  
57      /***
58       * Sets the template variable used by the Template Service.
59       * This method allows slashes '/' as the path separator.
60       *
61       * @param template A String with the template name.
62       * @return A TemplateLink.
63       */
64      public TemplateLink setPage(String template)
65      {
66          super.setPage(template.replace('/', ','));
67          return this;
68      }
69  }
70  
71