2
* Copyright 1999-2004 The Apache Software Foundation.
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
8
* http://www.apache.org/licenses/LICENSE-2.0
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.
18
package org.apache.struts.webapp.example2;
21
import javax.faces.component.UIComponent;
22
import javax.faces.el.ValueBinding;
23
import javax.faces.webapp.UIComponentTag;
27
* Generate a URL-encoded hyperlink to the specified URI, with
28
* associated query parameters selecting a specified Subscription.
30
* @author Craig R. McClanahan
31
* @version $Revision: 1.3 $ $Date: 2004/03/08 02:49:53 $
34
public class LinkSubscriptionTag extends UIComponentTag {
37
// -------------------------------------------------------------- Attributes
43
protected String name = "subscription";
45
public void setName(String name) {
51
* The context-relative URI.
53
protected String page = null;
55
public void setPage(String page) {
60
// ---------------------------------------------------------- Public Methods
64
* Return the component type for this tag.</p>
66
public String getComponentType() {
74
* <p>Return the renderer type associated with this tag.</p>
76
public String getRendererType() {
78
return ("LinkSubscription");
84
* <p>Release resources allocated to this tag instance.</p>
86
public void release() {
89
this.name = "subscription";
95
// ------------------------------------------------------- Protected Methods
99
* <p>Override attributes set on this tag instance.</p>
101
* @param component Component whose attributes should be overridden
103
protected void setProperties(UIComponent component) {
105
super.setProperties(component);
107
if (isValueReference(name)) {
109
getFacesContext().getApplication().createValueBinding(name);
110
component.setValueBinding("name", vb);
112
component.getAttributes().put("name", name);
116
if (isValueReference(page)) {
118
getFacesContext().getApplication().createValueBinding(page);
119
component.setValueBinding("page", vb);
121
component.getAttributes().put("page", page);