View Javadoc

1   /*
2    * Copyright 2002-2004 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.apache.struts.faces.taglib;
18  
19  
20  import javax.faces.component.UIComponent;
21  
22  
23  /***
24   * <p>Render a set of validation or business logic error messages, for
25   * the <em>Struts-Faces Integration Library</em>.</p>
26   *
27   *
28   * @version $Rev: 421138 $ $Date: 2006-07-11 22:41:40 -0700 (Tue, 11 Jul 2006) $
29   */
30  
31  public class ErrorsTag extends AbstractFacesTag {
32  
33  
34      // ---------------------------------------------------------- Tag Attributes
35  
36  
37      /***
38       * <p>The property name for which to report errors.</p>
39       */
40      protected String property = null;
41  
42      public void setProperty(String property) {
43          this.property = property;
44      }
45  
46  
47      // ---------------------------------------------------------- Public Methods
48  
49  
50      /***
51       * <p>Return the type of component to be created for this tag.</p>
52       */
53      public String getComponentType() {
54  
55          return ("org.apache.struts.faces.Errors");
56  
57      }
58  
59  
60      /***
61       * <p>Return the <code>rendererType</code> to be used for rendering
62       * our component.</p>
63       */
64      public String getRendererType() {
65  
66          return ("org.apache.struts.faces.Errors");
67  
68      }
69  
70  
71      /***
72       * <p>Release any variables allocated during use of this tag instance.</p>
73       */
74      public void release() {
75  
76          super.release();
77          this.property = null;
78  
79      }
80  
81  
82      // -------------------------------------------------- UIComponentTag Methods
83  
84  
85      /***
86       * <p>Override attributes set on this tag instance.</p>
87       *
88       * @param component Component whose attributes should be overridden
89       */
90      protected void setProperties(UIComponent component) {
91  
92          super.setProperties(component);
93          setStringAttribute(component, "property", property);
94  
95      }
96  
97  
98      // ------------------------------------------------------- Protected Methods
99  
100 
101 }