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 java.io.IOException;
17:
18: import javax.servlet.jsp.JspException;
19: import javax.servlet.jsp.JspTagException;
20: import javax.servlet.jsp.PageContext;
21: import javax.servlet.jsp.tagext.TagSupport;
22: import javax.servlet.http.HttpServletRequest;
23:
24: import javax.portlet.PortletConfig;
25: import javax.portlet.RenderRequest;
26: import javax.portlet.RenderResponse;
27:
28: /**
29: * This class implements the DefineObject tag. It makes available
30: * to the JSP variables : renderRequest, renderResponse, and portletConfig.
31: */
32: public class DefineObjectsTag extends TagSupport {
33:
34: public int doStartTag() throws JspException {
35:
36: HttpServletRequest req = (HttpServletRequest) pageContext
37: .getRequest();
38:
39: RenderRequest rReq = (RenderRequest) req
40: .getAttribute(PortletTaglibConstants.RENDER_REQUEST_ATTRIBUTE);
41: RenderResponse rRes = (RenderResponse) req
42: .getAttribute(PortletTaglibConstants.RENDER_RESPONSE_ATTRIBUTE);
43: PortletConfig pConfig = (PortletConfig) req
44: .getAttribute(PortletTaglibConstants.PORTLET_CONFIG_ATTRIBUTE);
45:
46: pageContext.setAttribute(
47: PortletTaglibConstants.RENDER_REQUEST_VAR, rReq);
48: pageContext.setAttribute(
49: PortletTaglibConstants.RENDER_RESPONSE_VAR, rRes);
50: pageContext.setAttribute(
51: PortletTaglibConstants.PORTLET_CONFIG_VAR, pConfig);
52:
53: return SKIP_BODY;
54: }
55: }
|