📄 strutsaction.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.4.2) on Wed Jul 19 18:22:43 EDT 2006 --><TITLE>StrutsAction (IBM WebSphere Portal Version 6.0.0.0 API Docs)</TITLE><META NAME="keywords" CONTENT="com.ibm.wps.struts.action.StrutsAction class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="StrutsAction (IBM WebSphere Portal Version 6.0.0.0 API Docs)";}</SCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <A HREF="#main"><FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT></A> </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="../../../../../serialized-form.html"><FONT CLASS="NavBarFont1"><B>Serialized</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></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../../../com/ibm/wps/struts/action/WpsDispatchAction.html" title="class in com.ibm.wps.struts.action"><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="StrutsAction.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#fields_inherited_from_class_org.apache.struts.action.Action">FIELD</A> | <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><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><A NAME="main"></A><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">com.ibm.wps.struts.action</FONT><BR>Class StrutsAction</H2><PRE>java.lang.Object <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by">org.apache.struts.action.Action <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><B>com.ibm.wps.struts.action.StrutsAction</B></PRE><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../com/ibm/wps/struts/action/WpsDispatchAction.html" title="class in com.ibm.wps.struts.action">WpsDispatchAction</A></DD></DL><HR><DL><DT>public class <B>StrutsAction</B><DT>extends org.apache.struts.action.Action</DL><P>A <strong>StrutsAction</strong> is an adapter between the contents of an incoming portlet request and the corresponding business logic that should be executed to process this request. The controller (WpsStrutsActionServlet) will select an appropriate StrutsAction for each request, create an instance (if necessary), and call the <code>execute</code> method.</p> <p>StrutsActions must be programmed in a thread-safe manner, because the controller will share the same instance for multiple simultaneous requests. This means you should design with the following items in mind: </p> <ul> <li>Instance and static variables MUST NOT be used to store information related to the state of a particular request. They MAY be used to share global resources across requests for the same action.</li> <li>Access to other resources (JavaBeans, session variables, etc.) MUST be synchronized if those resources require protection. (Generally, however, resource classes should be designed to provide their own protection where necessary.</li> </ul> <p>When a <code>StrutsAction</code> instance is first created, the controller servlet will call <code>setServlet()</code> with a non-null argument to identify the controller servlet instance to which this Action is attached. When the controller servlet is to be shut down (or restarted), the <code>setServlet()</code> method will be called with a <code>null</code> argument, which can be used to clean up any allocated resources in use by this Action.</p> <p>The StrutsAction is a Portal friendly action to which the portlet objects are passed directly. This is the preferred interface for Struts applications that do not need to support the servlet environment.</P><P><P><DL><DT><B>Since:</B></DT> <DD>4.1</DD></DL><HR><P><!-- ======== NESTED CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TH></TR></TABLE> <A NAME="fields_inherited_from_class_org.apache.struts.action.Action"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Fields inherited from class org.apache.struts.action.Action</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>ACTION_SERVLET_KEY, APPLICATION_KEY, DATA_SOURCE_KEY, defaultLocale, ERROR_KEY, EXCEPTION_KEY, FORM_BEANS_KEY, FORWARDS_KEY, LOCALE_KEY, MAPPING_KEY, MAPPINGS_KEY, MESSAGE_KEY, MESSAGES_KEY, MULTIPART_KEY, PLUG_INS_KEY, REQUEST_PROCESSOR_KEY, servlet, SERVLET_KEY, TRANSACTION_TOKEN_KEY</CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../../../com/ibm/wps/struts/action/StrutsAction.html#StrutsAction()">StrutsAction</A></B>()</CODE><BR> Constructor for this class.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> org.apache.struts.action.ActionForward</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/wps/struts/action/StrutsAction.html#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">execute</A></B>(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)</CODE><BR> <B>Deprecated.</B> <I>Use execute method taking mapping, form, request arguments only</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> org.apache.struts.action.ActionForward</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/wps/struts/action/StrutsAction.html#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, org.apache.jetspeed.portlet.PortletRequest)">execute</A></B>(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, <A HREF="../../../../../org/apache/jetspeed/portlet/PortletRequest.html" title="interface in org.apache.jetspeed.portlet">PortletRequest</A> request)</CODE><BR> Processes the current request based on the ActionMapping information.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> org.apache.struts.action.ActionForward</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/wps/struts/action/StrutsAction.html#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, org.apache.jetspeed.portlet.PortletRequest, org.apache.jetspeed.portlet.PortletResponse)">execute</A></B>(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, <A HREF="../../../../../org/apache/jetspeed/portlet/PortletRequest.html" title="interface in org.apache.jetspeed.portlet">PortletRequest</A> request, <A HREF="../../../../../org/apache/jetspeed/portlet/PortletResponse.html" title="interface in org.apache.jetspeed.portlet">PortletResponse</A> response)</CODE><BR> Processes the current request based on the ActionMapping information.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> org.apache.struts.action.ActionForward</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/wps/struts/action/StrutsAction.html#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.ServletRequest, javax.servlet.ServletResponse)">execute</A></B>(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)</CODE><BR> <B>Deprecated.</B> <I>Use execute method taking mapping, form, request arguments only</I></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="../../../../../com/ibm/wps/struts/action/StrutsAction.html#sendError(org.apache.jetspeed.portlet.PortletRequest, int)">sendError</A></B>(<A HREF="../../../../../org/apache/jetspeed/portlet/PortletRequest.html" title="interface in org.apache.jetspeed.portlet">PortletRequest</A> portletRequest, int sc)</CODE><BR> Sends an error response to the client using the specified status.</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="../../../../../com/ibm/wps/struts/action/StrutsAction.html#sendError(org.apache.jetspeed.portlet.PortletRequest, int, java.lang.String)">sendError</A></B>(<A HREF="../../../../../org/apache/jetspeed/portlet/PortletRequest.html" title="interface in org.apache.jetspeed.portlet">PortletRequest</A> portletRequest, int sc, java.lang.String msg)</CODE><BR> Sends an error response to the client using the specified status code and descriptive message.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_org.apache.struts.action.Action"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -