001// Licensed under the Apache License, Version 2.0 (the "License"); 002// you may not use this file except in compliance with the License. 003// You may obtain a copy of the License at 004// 005// http://www.apache.org/licenses/LICENSE-2.0 006// 007// Unless required by applicable law or agreed to in writing, software 008// distributed under the License is distributed on an "AS IS" BASIS, 009// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 010// See the License for the specific language governing permissions and 011// limitations under the License. 012 013package org.apache.tapestry5.corelib.base; 014 015import org.apache.tapestry5.annotations.Import; 016import org.apache.tapestry5.annotations.Property; 017import org.apache.tapestry5.http.services.Request; 018import org.apache.tapestry5.internal.InternalConstants; 019import org.apache.tapestry5.ioc.annotations.Inject; 020 021/** 022 * Base page for Tapestry internal pages, that should suppress any application changes to the core stack's CSS. 023 * CSS from the core stack is suppressed, instead the internal stack (which exists for just this purpose) 024 * is imported. 025 * 026 * @since 5.4 027 */ 028public abstract class AbstractInternalPage 029{ 030 @Inject @Property(write = false) 031 protected Request request; 032 033 void setupRender() 034 { 035 request.setAttribute(InternalConstants.SUPPRESS_CORE_STYLESHEETS, true); 036 } 037 038 @Import(stack = "internal") 039 void beginRender() 040 { 041 042 } 043}