001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.wicket.markup.html.pages;
018
019import org.apache.wicket.markup.head.CssHeaderItem;
020import org.apache.wicket.markup.head.IHeaderResponse;
021import org.apache.wicket.markup.html.WebPage;
022import org.apache.wicket.model.IModel;
023import org.apache.wicket.request.mapper.parameter.PageParameters;
024import org.apache.wicket.request.resource.CssResourceReference;
025
026/**
027 * A parent page for all pages that are used to show an error to the user. Setups the common
028 * settings for an error page.
029 */
030public abstract class AbstractErrorPage extends WebPage
031{
032        private static final long serialVersionUID = 1L;
033
034        protected AbstractErrorPage()
035        {
036                super();
037        }
038
039        protected AbstractErrorPage(final IModel<?> model)
040        {
041                super(model);
042        }
043
044        protected AbstractErrorPage(final PageParameters parameters)
045        {
046                super(parameters);
047        }
048
049        @Override
050        public boolean isErrorPage()
051        {
052                return true;
053        }
054
055        @Override
056        public boolean isVersioned()
057        {
058                return false;
059        }
060
061        @Override
062        public void renderHead(IHeaderResponse response)
063        {
064                super.renderHead(response);
065                response.render(CssHeaderItem
066                        .forReference(new CssResourceReference(AbstractErrorPage.class, "error.css")));
067        }
068}