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.containerProviderContext;
06:
07: import javax.servlet.jsp.JspException;
08: import javax.servlet.http.HttpServletRequest;
09: import javax.servlet.http.HttpServletResponse;
10:
11: import com.sun.portal.desktop.taglib.BaseDesktopTagSupport;
12: import com.sun.portal.desktop.taglib.DesktopTaglibException;
13: import com.sun.portal.providers.containers.ContainerProviderAdapter;
14: import com.sun.portal.providers.ProviderException;
15: import com.sun.portal.desktop.context.ContextException;
16: import com.sun.portal.providers.containers.JSPContainerProviderAdapter;
17:
18: public class GetContentTag extends BaseDesktopTagSupport {
19: String m_channel = null;
20:
21: public void setChannel(String channel) throws JspException {
22: m_channel = resolveParameter(channel).toString();
23: }
24:
25: public int doStartTag() throws JspException {
26: JSPContainerProviderAdapter cpa = (JSPContainerProviderAdapter) getCurrentObj();
27: StringBuffer sb = null;
28: try {
29: sb = cpa.getContainerProviderContext().getContent(
30: (HttpServletRequest) pageContext.getRequest(),
31: (HttpServletResponse) pageContext.getResponse(),
32: cpa.getName(), m_channel);
33: } catch (ProviderException pe) {
34: throw new DesktopTaglibException(pe);
35: }
36: if (sb != null) {
37: processResult(sb.toString());
38: }
39: return SKIP_BODY;
40: }
41: }
|