2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  /*
19   * $Id: PageNotFoundException.java 464373 2006-10-16 04:21:54Z rahul $
20   */
21  package org.apache.shale.clay.config.beans;
22  
23  /***
24   * <p>This is an unchecked exception used to identify that
25   * a {@link org.apache.shale.clay.component.Clay} template
26   * could not be found.  The exception captures the requested
27   * resource to be compared to the view root.  This is done
28   * by the {@link org.apache.shale.clay.faces.ClayViewHandler}
29   * in the <code>renderView</code> method.  If the missing
30   * template and the <code>viewId</code> are the same, a
31   * HTTP 404 status code is sent to the client.  If the
32   * missing template resource is nested in the page composition,
33   * the standard 500 status code will be returned.
34   *</p>
35   */
36  public class PageNotFoundException extends RuntimeException {
37  
38      /***
39       * <p>Unique serial is use in object serialization.</p>
40       */
41      private static final long serialVersionUID = 3258689897039672375L;
42      /***
43       * <p>The requested resource.</p>
44       */
45      private String resource = null;
46  
47      /***
48       * <p>Overloaded constructor requires an error message
49       * and the missing resource.</p>
50       *
51       * @param message  error message
52       * @param resource missing resource
53       */
54      public PageNotFoundException(String message, String resource) {
55         super(message);
56         this.resource = resource;
57      }
58  
59      /***
60       * <p>Returns the missing resource.</p>
61       *
62       * @return uri of the requested page
63       */
64      public String getResource() {
65          return resource;
66      }
67  
68  
69  }