View Javadoc

1   package org.apache.turbine.modules.pages;
2   
3   
4   /*
5    * Copyright 2001-2004 The Apache Software Foundation.
6    *
7    * Licensed under the Apache License, Version 2.0 (the "License")
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   *
11   *     http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  
21  import org.apache.turbine.pipeline.PipelineData;
22  import org.apache.turbine.services.jsp.TurbineJsp;
23  import org.apache.turbine.util.RunData;
24  
25  /***
26   * Extends TemplatePage to add some convenience objects to the request.
27   *
28   * @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
29   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
30   * @author <a href="mailto:peter@courcoux.biz">Peter Courcoux</a>
31   * @version $Revision: 222043 $
32   */
33  public class JspPage
34      extends TemplatePage
35  {
36      /***
37       * Stuffs some useful objects into the request so that
38       * it is available to the Action module and the Screen module
39       */
40      protected void doBuildBeforeAction(RunData data)
41          throws Exception
42      {
43          TurbineJsp.addDefaultObjects(data);
44  
45          try
46          {
47              //We try to set the buffer size from defaults
48              data.getResponse().setBufferSize(TurbineJsp.getDefaultBufferSize());
49          }
50          catch (IllegalStateException ise)
51          {
52              // If the response was already commited, we die silently
53              // No logger here?
54          }
55      }
56      
57      /***
58       * Stuffs some useful objects into the request so that
59       * it is available to the Action module and the Screen module
60       */
61      protected void doBuildBeforeAction(PipelineData pipelineData)
62          throws Exception
63      {
64          TurbineJsp.addDefaultObjects(pipelineData);
65  
66          try
67          {
68              RunData data = (RunData) getRunData(pipelineData);
69              //We try to set the buffer size from defaults
70              data.getResponse().setBufferSize(TurbineJsp.getDefaultBufferSize());
71          }
72          catch (IllegalStateException ise)
73          {
74              // If the response was already commited, we die silently
75              // No logger here?
76          }
77      }
78  
79  }