01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05: package com.sun.portal.desktop.taglib.providerContext;
06:
07: import javax.servlet.jsp.JspException;
08:
09: import com.sun.portal.providers.context.ProviderContext;
10:
11: import com.sun.portal.desktop.context.ContextException;
12: import com.sun.portal.desktop.taglib.DesktopTaglibException;
13:
14: public class GetClientTypePropertyTag extends
15: BaseProviderContextTagSupport {
16: private String m_key = null;
17: private String m_clientType = null;
18:
19: public void setKey(String key) throws DesktopTaglibException {
20: m_key = resolveParameter(key).toString();
21: }
22:
23: public void setClientType(String clientType)
24: throws DesktopTaglibException {
25: m_clientType = resolveParameter(clientType).toString();
26: }
27:
28: public int doStartTag() throws JspException {
29: ProviderContext pc = getCurrentProviderContext();
30: String result = null;
31: if (m_clientType == null) {
32: result = pc.getClientTypeProperty(m_key);
33: } else {
34: result = pc.getClientTypeProperty(m_key, m_clientType);
35: }
36: processResult(result);
37: return SKIP_BODY;
38: }
39: }
|