01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: */
13:
14: package com.sun.portal.portlet.taglib;
15:
16: import javax.servlet.jsp.JspException;
17: import javax.servlet.jsp.tagext.TagSupport;
18:
19: import javax.portlet.PortletURL;
20:
21: /**
22: * This class implements the Param tag which is used inside of the RenderURL tag or
23: * the ActionURL tag. It allows parameters to be associated with the URL.
24: */
25: public class ParamTag extends TagSupport {
26:
27: private String _name;
28: private String _value;
29:
30: public int doStartTag() throws JspException {
31:
32: if (_name != null && !_name.equals("")) {
33: PortletURLTag parent = (PortletURLTag) getParent();
34: PortletURL portletURL = parent.getURL();
35: portletURL.setParameter(_name, _value);
36: }
37:
38: return SKIP_BODY;
39: }
40:
41: public void setName(String name) {
42: _name = name;
43: }
44:
45: public void setValue(String value) {
46: _value = (value == null ? "" : value);
47: }
48: }
|