    001    package org.apache.turbine.modules.pages;
    002
    003
    004    /*
    005     * Licensed to the Apache Software Foundation (ASF) under one
    006     * or more contributor license agreements.  See the NOTICE file
    007     * distributed with this work for additional information
    008     * regarding copyright ownership.  The ASF licenses this file
    009     * to you under the Apache License, Version 2.0 (the
    010     * "License"); you may not use this file except in compliance
    011     * with the License.  You may obtain a copy of the License at
    012     *
    013     *   http://www.apache.org/licenses/LICENSE-2.0
    014     *
    015     * Unless required by applicable law or agreed to in writing,
    016     * software distributed under the License is distributed on an
    017     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    018     * KIND, either express or implied.  See the License for the
    019     * specific language governing permissions and limitations
    020     * under the License.
    021     */
    022
    023
    024    import org.apache.turbine.pipeline.PipelineData;
    025    import org.apache.turbine.services.jsp.TurbineJsp;
    026    import org.apache.turbine.util.RunData;
    027
    028    /**
    029     * Extends TemplatePage to add some convenience objects to the request.
    030     *
    031     * @author <a href="mailto:john.mcnally@clearink.com">John D. McNally</a>
    032     * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
    033     * @author <a href="mailto:peter@courcoux.biz">Peter Courcoux</a>
    034     * @version $Revision: 1078552 $
    035     */
    036    public class JspPage
    037        extends TemplatePage
    038    {
    039        /**
    040         * Stuffs some useful objects into the request so that
    041         * it is available to the Action module and the Screen module
    042         */
    043        @Override
    044        protected void doBuildBeforeAction(RunData data)
    045            throws Exception
    046        {
    047            TurbineJsp.addDefaultObjects(data);
    048
    049            try
    050            {
    051                //We try to set the buffer size from defaults
    052                data.getResponse().setBufferSize(TurbineJsp.getDefaultBufferSize());
    053            }
    054            catch (IllegalStateException ise)
    055            {
    056                // If the response was already commited, we die silently
    057                // No logger here?
    058            }
    059        }
    060
    061        /**
    062         * Stuffs some useful objects into the request so that
    063         * it is available to the Action module and the Screen module
    064         */
    065        @Override
    066        protected void doBuildBeforeAction(PipelineData pipelineData)
    067            throws Exception
    068        {
    069            TurbineJsp.addDefaultObjects(pipelineData);
    070
    071            try
    072            {
    073                RunData data = getRunData(pipelineData);
    074                //We try to set the buffer size from defaults
    075                data.getResponse().setBufferSize(TurbineJsp.getDefaultBufferSize());
    076            }
    077            catch (IllegalStateException ise)
    078            {
    079                // If the response was already commited, we die silently
    080                // No logger here?
    081            }
    082        }
    083
    084    }