⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 action.html

📁 struts api,学习使用struts必备的文档
💻 HTML
📖 第 1 页 / 共 4 页
字号:
<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="Action()"><!-- --></A><H3>
Action</H3>
<PRE>
public <B>Action</B>()</PRE>
<DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="getServlet()"><!-- --></A><H3>
getServlet</H3>
<PRE>
public <A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A> <B>getServlet</B>()</PRE>
<DL>
<DD><p>Return the servlet instance to which we are attached.</p></DL>
<HR>

<A NAME="setServlet(org.apache.struts.action.ActionServlet)"><!-- --></A><H3>
setServlet</H3>
<PRE>
public void <B>setServlet</B>(<A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A>&nbsp;servlet)</PRE>
<DL>
<DD><p>Set the servlet instance to which we are attached (if <code>servlet</code> is non-null), or release any allocated resources (if <code>servlet</code> is null).</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>servlet</CODE> - The new controller servlet, if any</DL>
</DD>
</DL>
<HR>

<A NAME="execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.ServletRequest, javax.servlet.ServletResponse)"><!-- --></A><H3>
execute</H3>
<PRE>
public <A HREF="../../../../org/apache/struts/action/ActionForward.html">ActionForward</A> <B>execute</B>(<A HREF="../../../../org/apache/struts/action/ActionMapping.html">ActionMapping</A>&nbsp;mapping,                             <A HREF="../../../../org/apache/struts/action/ActionForm.html">ActionForm</A>&nbsp;form,                             javax.servlet.ServletRequest&nbsp;request,                             javax.servlet.ServletResponse&nbsp;response)                      throws java.lang.Exception</PRE>
<DL>
<DD><p>Process the specified non-HTTP request, and create the corresponding non-HTTP response (or forward to another web component that will create it), with provision for handling exceptions thrown by the business logic. Return an <A HREF="../../../../org/apache/struts/action/ActionForward.html"><CODE>ActionForward</CODE></A> instance describing where and how control should be forwarded, or <code>null</code> if the response has already been completed.</p> <p>The default implementation attempts to forward to the HTTP version of this method.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>mapping</CODE> - The ActionMapping used to select this instance<DD><CODE>form</CODE> - The optional ActionForm bean for this request (if any)<DD><CODE>request</CODE> - The non-HTTP request we are processing<DD><CODE>response</CODE> - The non-HTTP response we are creating<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if the application business logic throws  an exception.<DT><B>Since: </B><DD>Struts 1.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
execute</H3>
<PRE>
public <A HREF="../../../../org/apache/struts/action/ActionForward.html">ActionForward</A> <B>execute</B>(<A HREF="../../../../org/apache/struts/action/ActionMapping.html">ActionMapping</A>&nbsp;mapping,                             <A HREF="../../../../org/apache/struts/action/ActionForm.html">ActionForm</A>&nbsp;form,                             javax.servlet.http.HttpServletRequest&nbsp;request,                             javax.servlet.http.HttpServletResponse&nbsp;response)                      throws java.lang.Exception</PRE>
<DL>
<DD><p>Process the specified HTTP request, and create the corresponding HTTP response (or forward to another web component that will create it), with provision for handling exceptions thrown by the business logic. Return an <A HREF="../../../../org/apache/struts/action/ActionForward.html"><CODE>ActionForward</CODE></A> instance describing where and how control should be forwarded, or <code>null</code> if the response has already been completed.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>mapping</CODE> - The ActionMapping used to select this instance<DD><CODE>form</CODE> - The optional ActionForm bean for this request (if any)<DD><CODE>request</CODE> - The HTTP request we are processing<DD><CODE>response</CODE> - The HTTP response we are creating<DT><B>Throws:</B><DD><CODE>java.lang.Exception</CODE> - if the application business logic throws  an exception<DT><B>Since: </B><DD>Struts 1.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="addMessages(javax.servlet.http.HttpServletRequest, org.apache.struts.action.ActionMessages)"><!-- --></A><H3>
addMessages</H3>
<PRE>
protected void <B>addMessages</B>(javax.servlet.http.HttpServletRequest&nbsp;request,                           <A HREF="../../../../org/apache/struts/action/ActionMessages.html">ActionMessages</A>&nbsp;messages)</PRE>
<DL>
<DD>Adds the specified messages keys into the appropriate request attribute for use by the &lt;html:messages&gt; tag (if messages="true" is set), if any messages are required. Initialize the attribute if it has not already been. Otherwise, ensure that the request attribute is not set.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing<DD><CODE>messages</CODE> - Messages object<DT><B>Since: </B><DD>Struts 1.2.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="addErrors(javax.servlet.http.HttpServletRequest, org.apache.struts.action.ActionMessages)"><!-- --></A><H3>
addErrors</H3>
<PRE>
protected void <B>addErrors</B>(javax.servlet.http.HttpServletRequest&nbsp;request,                         <A HREF="../../../../org/apache/struts/action/ActionMessages.html">ActionMessages</A>&nbsp;errors)</PRE>
<DL>
<DD>Adds the specified errors keys into the appropriate request attribute for use by the &lt;html:errors&gt; tag, if any messages are required. Initialize the attribute if it has not already been. Otherwise, ensure that the request attribute is not set.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing<DD><CODE>errors</CODE> - Errors object<DT><B>Since: </B><DD>Struts 1.2.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="generateToken(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
generateToken</H3>
<PRE>
protected java.lang.String <B>generateToken</B>(javax.servlet.http.HttpServletRequest&nbsp;request)</PRE>
<DL>
<DD><p>Generate a new transaction token, to be used for enforcing a single request for a particular transaction.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The request we are processing</DL>
</DD>
</DL>
<HR>

<A NAME="getDataSource(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
getDataSource</H3>
<PRE>
protected javax.sql.DataSource <B>getDataSource</B>(javax.servlet.http.HttpServletRequest&nbsp;request)</PRE>
<DL>
<DD><p>Return the default data source for the current module.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing<DT><B>Since: </B><DD>Struts 1.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="getDataSource(javax.servlet.http.HttpServletRequest, java.lang.String)"><!-- --></A><H3>
getDataSource</H3>
<PRE>
protected javax.sql.DataSource <B>getDataSource</B>(javax.servlet.http.HttpServletRequest&nbsp;request,                                             java.lang.String&nbsp;key)</PRE>
<DL>
<DD><p>Return the specified data source for the current module.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing<DD><CODE>key</CODE> - The key specified in the <code>&lt;data-sources&gt;</code>                element.<DT><B>Since: </B><DD>Struts 1.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="getErrors(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
getErrors</H3>
<PRE>
protected <A HREF="../../../../org/apache/struts/action/ActionMessages.html">ActionMessages</A> <B>getErrors</B>(javax.servlet.http.HttpServletRequest&nbsp;request)</PRE>
<DL>
<DD>Retrieves any existing errors placed in the request by previous actions.  This method could be called instead of creating a <code>new ActionMessages()<code> at the beginning of an <code>Action<code> This will prevent saveErrors() from wiping out any existing Errors<DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing<DT><B>Returns:</B><DD>the Errors that already exist in the request, or a new ActionMessages object if empty.<DT><B>Since: </B><DD>Struts 1.2.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="getLocale(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
getLocale</H3>
<PRE>
protected java.util.Locale <B>getLocale</B>(javax.servlet.http.HttpServletRequest&nbsp;request)</PRE>
<DL>
<DD><p>Return the user's currently selected Locale.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The request we are processing</DL>
</DD>
</DL>
<HR>

<A NAME="getMessages(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
getMessages</H3>
<PRE>
protected <A HREF="../../../../org/apache/struts/action/ActionMessages.html">ActionMessages</A> <B>getMessages</B>(javax.servlet.http.HttpServletRequest&nbsp;request)</PRE>
<DL>
<DD>Retrieves any existing messages placed in the request by previous actions.  This method could be called instead of creating a <code>new ActionMessages()<code> at the beginning of an <code>Action<code> This will prevent saveMessages() from wiping out any existing Messages<DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing<DT><B>Returns:</B><DD>the Messages that already exist in the request, or a new ActionMessages object if empty.<DT><B>Since: </B><DD>Struts 1.2.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="getResources(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
getResources</H3>
<PRE>
protected <A HREF="../../../../org/apache/struts/util/MessageResources.html">MessageResources</A> <B>getResources</B>(javax.servlet.http.HttpServletRequest&nbsp;request)</PRE>
<DL>
<DD><p>Return the default message resources for the current module.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing<DT><B>Since: </B><DD>Struts 1.1</DD>
</DL>
</DD>
</DL>
<HR>

<A NAME="getResources(javax.servlet.http.HttpServletRequest, java.lang.String)"><!-- --></A><H3>
getResources</H3>
<PRE>
protected <A HREF="../../../../org/apache/struts/util/MessageResources.html">MessageResources</A> <B>getResources</B>(javax.servlet.http.HttpServletRequest&nbsp;request,                                        java.lang.String&nbsp;key)</PRE>
<DL>
<DD><p>Return the specified message resources for the current module.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing<DD><CODE>key</CODE> - The key specified in the  <code>&lt;message-resources&gt;</code> element for the  requested bundle<DT><B>Since: </B><DD>Struts 1.1</DD>
</DL>
</DD>
</DL>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -