📄 genericportlet.html.svn-base
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Mon Sep 08 18:33:40 CEST 2003 --><TITLE>Portlet API (V1.0) : Class GenericPortlet</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_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"> PREV CLASS <A HREF="../../javax/portlet/PortletMode.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="GenericPortlet.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">javax.portlet</FONT><BR>Class GenericPortlet</H2><PRE>java.lang.Object | +--<B>javax.portlet.GenericPortlet</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../javax/portlet/Portlet.html">Portlet</A>, <A HREF="../../javax/portlet/PortletConfig.html">PortletConfig</A></DD></DL><HR><DL><DT>public abstract class <B>GenericPortlet</B><DT>extends java.lang.Object<DT>implements <A HREF="../../javax/portlet/Portlet.html">Portlet</A>, <A HREF="../../javax/portlet/PortletConfig.html">PortletConfig</A></DL><P>The <CODE>GenericPortlet</CODE> class provides a default implementation for the <CODE>Portlet</CODE> interface. <p> It provides an abstract class to be subclassed to create portlets. A subclass of <CODE>GenericPortlet</CODE> should override at least one method, usually one of the following: <ul> <li>processAction, to handle action requests</li> <li>doView, to handle render requests when in VIEW mode</li> <li>doEdit, to handle render requests when in EDIT mode</li> <li>doHelp, to handle render request when in HELP mode</li> <li>init and destroy, to manage resources that are held for the life of the servlet</li> </ul> <p> Normally there is no need to override the render or the doDispatch methods. Render handles render requests setting the title of the portlet in the response and invoking doDispatch. doDispatch dispatches the request to one of the doView, doEdit or doHelp method depending on the portlet mode indicated in the request. <p> Portlets typically run on multithreaded servers, so please note that a portlet must handle concurrent requests and be careful to synchronize access to shared resources. Shared resources include in-memory data such as instance or class variables and external objects such as files, database connections, and network connections.<P><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#GenericPortlet()">GenericPortlet</A></B>()</CODE><BR> Does nothing.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#destroy()">destroy</A></B>()</CODE><BR> Called by the portlet container to indicate to a portlet that the portlet is being taken out of service.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#doDispatch(javax.portlet.RenderRequest, javax.portlet.RenderResponse)">doDispatch</A></B>(<A HREF="../../javax/portlet/RenderRequest.html">RenderRequest</A> request, <A HREF="../../javax/portlet/RenderResponse.html">RenderResponse</A> response)</CODE><BR> The default implementation of this method routes the render request to a set of helper methods depending on the current portlet mode the portlet is currently in.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#doEdit(javax.portlet.RenderRequest, javax.portlet.RenderResponse)">doEdit</A></B>(<A HREF="../../javax/portlet/RenderRequest.html">RenderRequest</A> request, <A HREF="../../javax/portlet/RenderResponse.html">RenderResponse</A> response)</CODE><BR> Helper method to serve up the <code>edit</code> mode.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#doHelp(javax.portlet.RenderRequest, javax.portlet.RenderResponse)">doHelp</A></B>(<A HREF="../../javax/portlet/RenderRequest.html">RenderRequest</A> request, <A HREF="../../javax/portlet/RenderResponse.html">RenderResponse</A> response)</CODE><BR> Helper method to serve up the <code>help</code> mode.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)">doView</A></B>(<A HREF="../../javax/portlet/RenderRequest.html">RenderRequest</A> request, <A HREF="../../javax/portlet/RenderResponse.html">RenderResponse</A> response)</CODE><BR> Helper method to serve up the mandatory <code>view</code> mode.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#getInitParameter(java.lang.String)">getInitParameter</A></B>(java.lang.String name)</CODE><BR> Returns a String containing the value of the named initialization parameter, or null if the parameter does not exist.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.util.Enumeration</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#getInitParameterNames()">getInitParameterNames</A></B>()</CODE><BR> Returns the names of the portlet initialization parameters as an Enumeration of String objects, or an empty Enumeration if the portlet has no initialization parameters.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/portlet/PortletConfig.html">PortletConfig</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#getPortletConfig()">getPortletConfig</A></B>()</CODE><BR> Returns the PortletConfig object of this portlet.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../javax/portlet/PortletContext.html">PortletContext</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#getPortletContext()">getPortletContext</A></B>()</CODE><BR> Returns the <code>PortletContext</code> of the portlet application the portlet is in.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#getPortletName()">getPortletName</A></B>()</CODE><BR> Returns the name of this portlet.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.util.ResourceBundle</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/portlet/GenericPortlet.html#getResourceBundle(java.util.Locale)">getResourceBundle</A></B>(java.util.Locale locale)</CODE><BR> Gets the resource bundle for the given locale based on the resource bundle defined in the deployment descriptor with <code>resource-bundle</code> tag or the inlined resources
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -