?? dispatchaction.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:42 EDT 2006 --><TITLE>DispatchAction (IBM WebSphere Portal Version 6.0.0.0 API Docs)</TITLE><META NAME="keywords" CONTENT="com.ibm.portal.struts.action.DispatchAction class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){ parent.document.title="DispatchAction (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/portal/struts/action/LookupDispatchAction.html" title="class in com.ibm.portal.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="DispatchAction.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="#field_summary">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: <A HREF="#field_detail">FIELD</A> | <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.portal.struts.action</FONT><BR>Class DispatchAction</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"><A HREF="../../../../../com/ibm/portal/struts/action/StrutsAction.html" title="class in com.ibm.portal.struts.action">com.ibm.portal.struts.action.StrutsAction</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by"><B>com.ibm.portal.struts.action.DispatchAction</B></PRE><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../com/ibm/portal/struts/action/LookupDispatchAction.html" title="class in com.ibm.portal.struts.action">LookupDispatchAction</A></DD></DL><HR><DL><DT>public abstract class <B>DispatchAction</B><DT>extends <A HREF="../../../../../com/ibm/portal/struts/action/StrutsAction.html" title="class in com.ibm.portal.struts.action">StrutsAction</A></DL><P><p>This is a Portal friendly version of DispatchAction. The basic difference is the request object is a PortletRequest object and there is no response object.</p> <p>Derived from the Struts DispatchAction javadoc:</p> <p> An abstract <strong>Action</strong> that dispatches to a public method that is named by the request parameter whose name is specified by the <code>parameter</code> property of the corresponding ActionMapping. This Action is useful for developers who prefer to combine many similar actions into a single Action class, in order to simplify their application design.</p> <p>To configure the use of this action in your <code>struts-config.xml</code> file, create an entry like this:</p> <code> <action path="/saveSubscription" type="org.apache.struts.actions.DispatchAction" name="subscriptionForm" scope="request" input="/subscription.jsp" parameter="method"/> </code> <p>which will use the value of the request parameter named "method" to pick the appropriate "execute" method, which must have the same signature (other than method name) of the standard Action.execute method. For example, you might have the following three methods in the same action:</p> <ul> <li>public ActionForward delete(ActionMapping mapping, ActionForm form, PortletRequest request ) throws Exception</li> <li>public ActionForward insert(ActionMapping mapping, ActionForm form, PortletRequest request) throws Exception</li> <li>public ActionForward update(ActionMapping mapping, ActionForm form, PortletRequest request) throws Exception</li> </ul> <p>and call one of the methods with a URL like this:</p> <code> <html:link action="/saveSubscription.do?method=update"> </code> <p><strong>NOTE</strong> - All of the other mapping characteristics of this action must be shared by the various handlers. This places some constraints over what types of handlers may reasonably be packaged into the same <code>DispatchAction</code> subclass.</p><P><P><DL><DT><B>Since:</B></DT> <DD>5.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><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.Class</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/action/DispatchAction.html#clazz">clazz</A></B></CODE><BR> The Class instance of this <code>DispatchAction</code> class.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected static org.apache.commons.logging.Log</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/action/DispatchAction.html#log">log</A></B></CODE><BR> Commons Logging instance.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected static org.apache.struts.util.MessageResources</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/action/DispatchAction.html#messages">messages</A></B></CODE><BR> The message resources for this package.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.util.HashMap</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/action/DispatchAction.html#methods">methods</A></B></CODE><BR> The set of Method objects introspected for this class, keyed by method name.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected java.lang.Class[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/action/DispatchAction.html#types">types</A></B></CODE><BR> The set of argument type classes for the reflected method call.</TD></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/portal/struts/action/DispatchAction.html#DispatchAction()">DispatchAction</A></B>()</CODE><BR> DispatchAction constructor.</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>protected org.apache.struts.action.ActionForward</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/action/DispatchAction.html#dispatchMethod(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.portlet.ActionRequest, javax.portlet.ActionResponse, java.lang.String)">dispatchMethod</A></B>(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.portlet.ActionRequest request, javax.portlet.ActionResponse response, java.lang.String name)</CODE><BR> Dispatches to the specified method.</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/portal/struts/action/DispatchAction.html#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.portlet.ActionRequest, javax.portlet.ActionResponse)">execute</A></B>(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.portlet.ActionRequest request, javax.portlet.ActionResponse 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>protected java.lang.reflect.Method</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/action/DispatchAction.html#getMethod(java.lang.String)">getMethod</A></B>(java.lang.String name)</CODE><BR> Introspect the current class to identify a method of the specified name that accepts the same parameter types as the <code>execute</code> method does.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected org.apache.struts.action.ActionForward</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../com/ibm/portal/struts/action/DispatchAction.html#unspecified(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.portlet.ActionRequest)">unspecified</A></B>(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.portlet.ActionRequest request)</CODE><BR> Method which is dispatched to when there is no value for specified request parameter included in the request.</TD>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -