📄 renderresponse.html.svn-base
字号:
</DL><HR><A NAME="createActionURL()"><!-- --></A><H3>createActionURL</H3><PRE>public <A HREF="../../javax/portlet/PortletURL.html">PortletURL</A> <B>createActionURL</B>()</PRE><DL><DD>Creates a portlet URL targeting the portlet. If no portlet mode, window state or security modifier is set in the PortletURL the current values are preserved. If a request is triggered by the PortletURL, it results in an action request. <p> The returned URL can be further extended by adding portlet-specific parameters and portlet modes and window states. <p> The created URL will per default not contain any parameters of the current render request.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a portlet action URL</DL></DD></DL><HR><A NAME="getNamespace()"><!-- --></A><H3>getNamespace</H3><PRE>public java.lang.String <B>getNamespace</B>()</PRE><DL><DD>The value returned by this method should be prefixed or appended to elements, such as JavaScript variables or function names, to ensure they are unique in the context of the portal page.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the namespace</DL></DD></DL><HR><A NAME="setTitle(java.lang.String)"><!-- --></A><H3>setTitle</H3><PRE>public void <B>setTitle</B>(java.lang.String title)</PRE><DL><DD>This method sets the title of the portlet. <p> The value can be a text String<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>title</CODE> - portlet title as text String or resource URI</DL></DD></DL><HR><A NAME="setContentType(java.lang.String)"><!-- --></A><H3>setContentType</H3><PRE>public void <B>setContentType</B>(java.lang.String type)</PRE><DL><DD>Sets the MIME type for the render response. The portlet must set the content type before calling <A HREF="../../javax/portlet/RenderResponse.html#getWriter()"><CODE>getWriter()</CODE></A> or <A HREF="../../javax/portlet/RenderResponse.html#getPortletOutputStream()"><CODE>getPortletOutputStream()</CODE></A>. <p> Calling <code>setContentType</code> after <code>getWriter</code> or <code>getOutputStream</code> does not change the content type.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>type</CODE> - the content MIME type<DT><B>Throws:</B><DD><CODE>java.lang.IllegalArgumentException</CODE> - if the given type is not in the list returned by <code>PortletRequest.getResponseContentTypes</code><DT><B>See Also: </B><DD><A HREF="../../javax/portlet/PortletRequest.html#getResponseContentTypes()"><CODE>PortletRequest.getResponseContentTypes()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#getContentType()"><CODE>getContentType()</CODE></A></DL></DD></DL><HR><A NAME="getCharacterEncoding()"><!-- --></A><H3>getCharacterEncoding</H3><PRE>public java.lang.String <B>getCharacterEncoding</B>()</PRE><DL><DD>Returns the name of the charset used for the MIME body sent in this response. <p>See <a href="http://ds.internic.net/rfc/rfc2045.txt">RFC 2047</a> for more information about character encoding and MIME.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>String</code> specifying the name of the charset, for example, <code>ISO-8859-1</code></DL></DD></DL><HR><A NAME="getWriter()"><!-- --></A><H3>getWriter</H3><PRE>public java.io.PrintWriter <B>getWriter</B>() throws java.io.IOException</PRE><DL><DD>Returns a PrintWriter object that can send character text to the portal. <p> Before calling this method the content type of the render response must be set using the <A HREF="../../javax/portlet/RenderResponse.html#setContentType(java.lang.String)"><CODE>setContentType(java.lang.String)</CODE></A> method. <p> Either this method or <A HREF="../../javax/portlet/RenderResponse.html#getPortletOutputStream()"><CODE>getPortletOutputStream()</CODE></A> may be called to write the body, not both.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>PrintWriter</code> object that can return character data to the portal<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an input or output exception occurred<DD><CODE>java.lang.IllegalStateException</CODE> - if the <code>getPortletOutputStream</code> method has been called on this response, or if no content type was set using the <code>setContentType</code> method.<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/RenderResponse.html#setContentType(java.lang.String)"><CODE>setContentType(java.lang.String)</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#getPortletOutputStream()"><CODE>getPortletOutputStream()</CODE></A></DL></DD></DL><HR><A NAME="getLocale()"><!-- --></A><H3>getLocale</H3><PRE>public java.util.Locale <B>getLocale</B>()</PRE><DL><DD>Returns the locale assigned to the response.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>Locale of this response</DL></DD></DL><HR><A NAME="setBufferSize(int)"><!-- --></A><H3>setBufferSize</H3><PRE>public void <B>setBufferSize</B>(int size)</PRE><DL><DD>Sets the preferred buffer size for the body of the response. The portlet container will use a buffer at least as large as the size requested. <p> This method must be called before any response body content is written; if content has been written, or the portlet container does not support buffering, this method may throw an <code>IllegalStateException</code>.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>size</CODE> - the preferred buffer size<DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - if this method is called after content has been written, or the portlet container does not support buffering<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/RenderResponse.html#getBufferSize()"><CODE>getBufferSize()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#flushBuffer()"><CODE>flushBuffer()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#isCommitted()"><CODE>isCommitted()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#reset()"><CODE>reset()</CODE></A></DL></DD></DL><HR><A NAME="getBufferSize()"><!-- --></A><H3>getBufferSize</H3><PRE>public int <B>getBufferSize</B>()</PRE><DL><DD>Returns the actual buffer size used for the response. If no buffering is used, this method returns 0.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the actual buffer size used<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/RenderResponse.html#setBufferSize(int)"><CODE>setBufferSize(int)</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#flushBuffer()"><CODE>flushBuffer()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#isCommitted()"><CODE>isCommitted()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#reset()"><CODE>reset()</CODE></A></DL></DD></DL><HR><A NAME="flushBuffer()"><!-- --></A><H3>flushBuffer</H3><PRE>public void <B>flushBuffer</B>() throws java.io.IOException</PRE><DL><DD>Forces any content in the buffer to be written to the client. A call to this method automatically commits the response.<DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an error occured when writing the output<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/RenderResponse.html#setBufferSize(int)"><CODE>setBufferSize(int)</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#getBufferSize()"><CODE>getBufferSize()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#isCommitted()"><CODE>isCommitted()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#reset()"><CODE>reset()</CODE></A></DL></DD></DL><HR><A NAME="resetBuffer()"><!-- --></A><H3>resetBuffer</H3><PRE>public void <B>resetBuffer</B>()</PRE><DL><DD>Clears the content of the underlying buffer in the response without clearing properties set. If the response has been committed, this method throws an <code>IllegalStateException</code>.<DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>IllegalStateException</CODE> - if this method is called after response is comitted<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/RenderResponse.html#setBufferSize(int)"><CODE>setBufferSize(int)</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#getBufferSize()"><CODE>getBufferSize()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#isCommitted()"><CODE>isCommitted()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#reset()"><CODE>reset()</CODE></A></DL></DD></DL><HR><A NAME="isCommitted()"><!-- --></A><H3>isCommitted</H3><PRE>public boolean <B>isCommitted</B>()</PRE><DL><DD>Returns a boolean indicating if the response has been committed.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a boolean indicating if the response has been committed<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/RenderResponse.html#setBufferSize(int)"><CODE>setBufferSize(int)</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#getBufferSize()"><CODE>getBufferSize()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#flushBuffer()"><CODE>flushBuffer()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#reset()"><CODE>reset()</CODE></A></DL></DD></DL><HR><A NAME="reset()"><!-- --></A><H3>reset</H3><PRE>public void <B>reset</B>()</PRE><DL><DD>Clears any data that exists in the buffer as well as the properties set. If the response has been committed, this method throws an <code>IllegalStateException</code>.<DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - if the response has already been committed<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/RenderResponse.html#setBufferSize(int)"><CODE>setBufferSize(int)</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#getBufferSize()"><CODE>getBufferSize()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#flushBuffer()"><CODE>flushBuffer()</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#isCommitted()"><CODE>isCommitted()</CODE></A></DL></DD></DL><HR><A NAME="getPortletOutputStream()"><!-- --></A><H3>getPortletOutputStream</H3><PRE>public java.io.OutputStream <B>getPortletOutputStream</B>() throws java.io.IOException</PRE><DL><DD>Returns a <code>OutputStream</code> suitable for writing binary data in the response. The portlet container does not encode the binary data. <p> Before calling this method the content type of the render response must be set using the <A HREF="../../javax/portlet/RenderResponse.html#setContentType(java.lang.String)"><CODE>setContentType(java.lang.String)</CODE></A> method. <p> Calling <code>flush()</code> on the OutputStream commits the response. <p> Either this method or <A HREF="../../javax/portlet/RenderResponse.html#getWriter()"><CODE>getWriter()</CODE></A> may be called to write the body, not both.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>a <code>OutputStream</code> for writing binary data<DT><B>Throws:</B><DD><CODE>java.lang.IllegalStateException</CODE> - if the <code>getWriter</code> method has been called on this response, or if no content type was set using the <code>setContentType</code> method.<DD><CODE>java.io.IOException</CODE> - if an input or output exception occurred<DT><B>See Also: </B><DD><A HREF="../../javax/portlet/RenderResponse.html#setContentType(java.lang.String)"><CODE>setContentType(java.lang.String)</CODE></A>, <A HREF="../../javax/portlet/RenderResponse.html#getWriter()"><CODE>getWriter()</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>Portlet API (V1.0) </EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javax/portlet/RenderRequest.html"><B>PREV CLASS</B></A> NEXT CLASS</FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="RenderResponse.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><a href=license.txt >Copyright</a> © 2003 IBM Corporation and Sun Microsystems, Inc. All rights reserved</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -