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   * $Id: Status.java 464373 2006-10-16 04:21:54Z rahul $
18   */
19  
20  package org.apache.shale.examples.test.view;
21  
22  import javax.faces.context.FacesContext;
23  import org.apache.shale.view.AbstractViewController;
24  import org.apache.shale.view.Constants;
25  import org.apache.shale.view.faces.FacesConstants;
26  
27  /***
28   * <p>View Controller class for <code>/status.jsp</code>.</p>
29   */
30  public class Status extends AbstractViewController {
31      
32  
33      // -------------------------------------------------------------- Properties
34  
35  
36      /***
37       * <p>Return the class name of the attribute configured under name
38       * {@link FacesConstants.EXCEPTION_HANDLER}.</p>
39       */
40      public String getExceptionHandler() {
41          FacesContext context = FacesContext.getCurrentInstance();
42          Object result = context.getApplication().getVariableResolver().
43                  resolveVariable(context, Constants.EXCEPTION_HANDLER);
44          if (result == null) {
45              return null;
46          } else {
47              return result.getClass().getName();
48          }
49      }
50  
51  
52      /***
53       * <p>Return the class name of the attribute configured under name
54       * {@link FacesConstants.VIEW_CALLBACKS}.</p>
55       */
56      public String getViewCallbacks() {
57          FacesContext context = FacesContext.getCurrentInstance();
58          Object result = context.getApplication().getVariableResolver().
59                  resolveVariable(context, FacesConstants.VIEW_CALLBACKS);
60          if (result == null) {
61              return null;
62          } else {
63              return result.getClass().getName();
64          }
65      }
66  
67  
68      /***
69       * <p>Return the class name of the attribute configured under name
70       * {@link FacesConstants.VIEW_MAPPER}.</p>
71       */
72      public String getViewMapper() {
73          FacesContext context = FacesContext.getCurrentInstance();
74          Object result = context.getApplication().getVariableResolver().
75                  resolveVariable(context, Constants.VIEW_MAPPER);
76          if (result == null) {
77              return null;
78          } else {
79              return result.getClass().getName();
80          }
81      }
82  
83  
84      // -------------------------------------------------------- Lifecycle Events
85  
86  
87  }