1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
5
<!-- Generated by javadoc on Fri Jun 15 16:53:35 PDT 2001 -->
7
Apache Struts API Documentation: Class Action
9
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
11
<BODY BGCOLOR="white">
13
<!-- ========== START OF NAVBAR ========== -->
14
<A NAME="navbar_top"><!-- --></A>
15
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
17
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
18
<A NAME="navbar_top_firstrow"><!-- --></A>
19
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
20
<TR ALIGN="center" VALIGN="top">
21
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
22
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
23
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
24
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
25
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
26
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
27
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
31
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
37
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
38
PREV CLASS
39
<A HREF="../../../../org/apache/struts/action/ActionBase.html"><B>NEXT CLASS</B></A></FONT></TD>
40
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
41
<A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
42
<A HREF="Action.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
45
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
46
SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
47
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
48
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
51
<!-- =========== END OF NAVBAR =========== -->
54
<!-- ======== START OF CLASS DATA ======== -->
57
org.apache.struts.action</FONT>
63
+--<B>org.apache.struts.action.Action</B>
66
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../org/apache/struts/action/ActionBase.html">ActionBase</A>, <A HREF="../../../../org/apache/struts/actions/AddFormBeanAction.html">AddFormBeanAction</A>, <A HREF="../../../../org/apache/struts/actions/AddForwardAction.html">AddForwardAction</A>, <A HREF="../../../../org/apache/struts/actions/AddMappingAction.html">AddMappingAction</A>, <A HREF="../../../../org/apache/struts/actions/DispatchAction.html">DispatchAction</A>, <A HREF="../../../../org/apache/struts/actions/ForwardAction.html">ForwardAction</A>, <A HREF="../../../../org/apache/struts/actions/IncludeAction.html">IncludeAction</A>, <A HREF="../../../../org/apache/struts/actions/ReloadAction.html">ReloadAction</A>, <A HREF="../../../../org/apache/struts/actions/RemoveFormBeanAction.html">RemoveFormBeanAction</A>, <A HREF="../../../../org/apache/struts/actions/RemoveForwardAction.html">RemoveForwardAction</A>, <A HREF="../../../../org/apache/struts/actions/RemoveMappingAction.html">RemoveMappingAction</A></DD>
70
<DT>public class <B>Action</B><DT>extends java.lang.Object</DL>
73
An <strong>Action</strong> is an adapter between the contents of an incoming
74
HTTP request and the corresponding business logic that should be executed to
75
process this request. The controller (ActionServlet) will select an
76
appropriate Action for each request, create an instance (if necessary),
77
and call the <code>perform</code> method.
79
Actions must be programmed in a thread-safe manner, because the controller
80
will share the same instance for multiple simultaneous requests. In
81
this means you should design with the following items in mind:
83
<li>Instance and static variables MUST NOT be used to store information
84
related to the state of a particular request. They MAY be used to
85
share global resources across requests for the same action.</li>
86
<li>Access to other resources (JavaBeans, session variables, etc.) MUST
87
be synchronized if those resources require protection. (Generally,
88
however, resource classes should be designed to provide their own
89
protection where necessary.</li>
92
When an <code>Action</code> instance is first created, the controller
93
servlet will call <code>setServlet()</code> with a non-null argument to
94
identify the controller servlet instance to which this Action is attached.
95
When the controller servlet is to be shut down (or restarted), the
96
<code>setServlet()</code> method will be called with a <code>null</code>
97
argument, which can be used to clean up any allocated resources in use
101
<DT><B>Version: </B><DD>$Revision: 1.1 $ $Date: 2001/09/17 20:03:01 $</DD>
102
<DT><B>Author: </B><DD>Craig R. McClanahan</DD>
107
<!-- ======== INNER CLASS SUMMARY ======== -->
110
<!-- =========== FIELD SUMMARY =========== -->
112
<A NAME="field_summary"><!-- --></A>
113
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
114
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
115
<TD COLSPAN=2><FONT SIZE="+2">
116
<B>Field Summary</B></FONT></TD>
118
<TR BGCOLOR="white" CLASS="TableRowColor">
119
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
120
<CODE>static java.lang.String</CODE></FONT></TD>
121
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#DATA_SOURCE_KEY">DATA_SOURCE_KEY</A></B></CODE>
124
The context attributes key under which our <strong>default</strong>
125
configured data source (which must implement
126
<code>javax.sql.DataSource</code>) is stored,
127
if one is configured for this application.</TD>
129
<TR BGCOLOR="white" CLASS="TableRowColor">
130
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
131
<CODE>protected static java.util.Locale</CODE></FONT></TD>
132
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#defaultLocale">defaultLocale</A></B></CODE>
135
The system default Locale.</TD>
137
<TR BGCOLOR="white" CLASS="TableRowColor">
138
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
139
<CODE>static java.lang.String</CODE></FONT></TD>
140
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#ERROR_KEY">ERROR_KEY</A></B></CODE>
143
The request attributes key under which your action should store an
144
<code>org.apache.struts.action.ActionErrors</code> object, if you
145
are using the corresponding custom tag library elements.</TD>
147
<TR BGCOLOR="white" CLASS="TableRowColor">
148
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
149
<CODE>static java.lang.String</CODE></FONT></TD>
150
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#EXCEPTION_KEY">EXCEPTION_KEY</A></B></CODE>
153
The request attributes key under which Struts custom tags might store a
154
<code>Throwable</code> that caused them to report a JspException at
157
<TR BGCOLOR="white" CLASS="TableRowColor">
158
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
159
<CODE>static java.lang.String</CODE></FONT></TD>
160
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#FORM_BEANS_KEY">FORM_BEANS_KEY</A></B></CODE>
163
The context attributes key under which our
164
<code>org.apache.struts.action.ActionFormBeans</code> collection
165
is normally stored, unless overridden when initializing our
168
<TR BGCOLOR="white" CLASS="TableRowColor">
169
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
170
<CODE>static java.lang.String</CODE></FONT></TD>
171
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#FORWARDS_KEY">FORWARDS_KEY</A></B></CODE>
174
The context attributes key under which our
175
<code>org.apache.struts.action.ActionForwards</code> collection
176
is normally stored, unless overridden when initializing our
179
<TR BGCOLOR="white" CLASS="TableRowColor">
180
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
181
<CODE>static java.lang.String</CODE></FONT></TD>
182
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#LOCALE_KEY">LOCALE_KEY</A></B></CODE>
185
The session attributes key under which the user's selected
186
<code>java.util.Locale</code> is stored, if any.</TD>
188
<TR BGCOLOR="white" CLASS="TableRowColor">
189
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
190
<CODE>static java.lang.String</CODE></FONT></TD>
191
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#MAPPING_KEY">MAPPING_KEY</A></B></CODE>
194
The request attributes key under which our
195
<code>org.apache.struts.ActionMapping</code> instance
198
<TR BGCOLOR="white" CLASS="TableRowColor">
199
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
200
<CODE>static java.lang.String</CODE></FONT></TD>
201
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#MAPPINGS_KEY">MAPPINGS_KEY</A></B></CODE>
204
The context attributes key under which our
205
<code>org.apache.struts.action.ActionMappings</code> collection
206
is normally stored, unless overridden when initializing our
209
<TR BGCOLOR="white" CLASS="TableRowColor">
210
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
211
<CODE>static java.lang.String</CODE></FONT></TD>
212
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#MESSAGES_KEY">MESSAGES_KEY</A></B></CODE>
215
The context attributes key under which our application resources are
216
normally stored, unless overridden when initializing our ActionServlet.</TD>
218
<TR BGCOLOR="white" CLASS="TableRowColor">
219
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
220
<CODE>static java.lang.String</CODE></FONT></TD>
221
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#MULTIPART_KEY">MULTIPART_KEY</A></B></CODE>
224
The request attributes key under which our multipart class is stored.</TD>
226
<TR BGCOLOR="white" CLASS="TableRowColor">
227
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
228
<CODE>protected <A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A></CODE></FONT></TD>
229
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#servlet">servlet</A></B></CODE>
232
The controller servlet to which we are attached.</TD>
234
<TR BGCOLOR="white" CLASS="TableRowColor">
235
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
236
<CODE>static java.lang.String</CODE></FONT></TD>
237
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#SERVLET_KEY">SERVLET_KEY</A></B></CODE>
240
The context attributes key under which we store the mapping defined
241
for our controller serlet, which will be either a path-mapped pattern
242
(<code>/action/*</code>) or an extension mapped pattern
243
(<code>*.do</code>).</TD>
245
<TR BGCOLOR="white" CLASS="TableRowColor">
246
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
247
<CODE>static java.lang.String</CODE></FONT></TD>
248
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#TRANSACTION_TOKEN_KEY">TRANSACTION_TOKEN_KEY</A></B></CODE>
251
The session attributes key under which our transaction token is
252
stored, if it is used.</TD>
256
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
258
<A NAME="constructor_summary"><!-- --></A>
259
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
260
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
261
<TD COLSPAN=2><FONT SIZE="+2">
262
<B>Constructor Summary</B></FONT></TD>
264
<TR BGCOLOR="white" CLASS="TableRowColor">
265
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#Action()">Action</A></B>()</CODE>
268
</TD>
272
<!-- ========== METHOD SUMMARY =========== -->
274
<A NAME="method_summary"><!-- --></A>
275
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
276
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
277
<TD COLSPAN=2><FONT SIZE="+2">
278
<B>Method Summary</B></FONT></TD>
280
<TR BGCOLOR="white" CLASS="TableRowColor">
281
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
282
<CODE>protected java.lang.String</CODE></FONT></TD>
283
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#generateToken(javax.servlet.http.HttpServletRequest)">generateToken</A></B>(javax.servlet.http.HttpServletRequest request)</CODE>
286
Generate a new transaction token, to be used for enforcing a single
287
request for a particular transaction.</TD>
289
<TR BGCOLOR="white" CLASS="TableRowColor">
290
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
291
<CODE>protected java.util.Locale</CODE></FONT></TD>
292
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#getLocale(javax.servlet.http.HttpServletRequest)">getLocale</A></B>(javax.servlet.http.HttpServletRequest request)</CODE>
295
Return the user's currently selected Locale.</TD>
297
<TR BGCOLOR="white" CLASS="TableRowColor">
298
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
299
<CODE>protected <A HREF="../../../../org/apache/struts/util/MessageResources.html">MessageResources</A></CODE></FONT></TD>
300
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#getResources()">getResources</A></B>()</CODE>
303
Return the message resources for this application.</TD>
305
<TR BGCOLOR="white" CLASS="TableRowColor">
306
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
307
<CODE> <A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A></CODE></FONT></TD>
308
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#getServlet()">getServlet</A></B>()</CODE>
311
Return the controller servlet instance to which we are attached.</TD>
313
<TR BGCOLOR="white" CLASS="TableRowColor">
314
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
315
<CODE>protected boolean</CODE></FONT></TD>
316
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#isCancelled(javax.servlet.http.HttpServletRequest)">isCancelled</A></B>(javax.servlet.http.HttpServletRequest request)</CODE>
319
Returns <code>true</code> if the current form's cancel button was
322
<TR BGCOLOR="white" CLASS="TableRowColor">
323
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
324
<CODE>protected boolean</CODE></FONT></TD>
325
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#isTokenValid(javax.servlet.http.HttpServletRequest)">isTokenValid</A></B>(javax.servlet.http.HttpServletRequest request)</CODE>
328
Return <code>true</code> if there is a transaction token stored in
329
the user's current session, and the value submitted as a request
330
parameter with this action matches it.</TD>
332
<TR BGCOLOR="white" CLASS="TableRowColor">
333
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
334
<CODE> <A HREF="../../../../org/apache/struts/action/ActionForward.html">ActionForward</A></CODE></FONT></TD>
335
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#perform(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">perform</A></B>(<A HREF="../../../../org/apache/struts/action/ActionMapping.html">ActionMapping</A> mapping,
336
<A HREF="../../../../org/apache/struts/action/ActionForm.html">ActionForm</A> form,
337
javax.servlet.http.HttpServletRequest request,
338
javax.servlet.http.HttpServletResponse response)</CODE>
341
Process the specified HTTP request, and create the corresponding HTTP
342
response (or forward to another web component that will create it).</TD>
344
<TR BGCOLOR="white" CLASS="TableRowColor">
345
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
346
<CODE> <A HREF="../../../../org/apache/struts/action/ActionForward.html">ActionForward</A></CODE></FONT></TD>
347
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#perform(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.ServletRequest, javax.servlet.ServletResponse)">perform</A></B>(<A HREF="../../../../org/apache/struts/action/ActionMapping.html">ActionMapping</A> mapping,
348
<A HREF="../../../../org/apache/struts/action/ActionForm.html">ActionForm</A> form,
349
javax.servlet.ServletRequest request,
350
javax.servlet.ServletResponse response)</CODE>
353
Process the specified non-HTTP request, and create the corresponding
354
non-HTTP response (or forward to another web component that will create
357
<TR BGCOLOR="white" CLASS="TableRowColor">
358
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
359
<CODE> <A HREF="../../../../org/apache/struts/action/ActionForward.html">ActionForward</A></CODE></FONT></TD>
360
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#perform(org.apache.struts.action.ActionServlet, org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)">perform</A></B>(<A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A> servlet,
361
<A HREF="../../../../org/apache/struts/action/ActionMapping.html">ActionMapping</A> mapping,
362
<A HREF="../../../../org/apache/struts/action/ActionForm.html">ActionForm</A> form,
363
javax.servlet.http.HttpServletRequest request,
364
javax.servlet.http.HttpServletResponse response)</CODE>
367
<B>Deprecated.</B> <I>Use the new perform() method without a servlet argument</I></TD>
369
<TR BGCOLOR="white" CLASS="TableRowColor">
370
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
371
<CODE> <A HREF="../../../../org/apache/struts/action/ActionForward.html">ActionForward</A></CODE></FONT></TD>
372
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#perform(org.apache.struts.action.ActionServlet, org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.ServletRequest, javax.servlet.ServletResponse)">perform</A></B>(<A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A> servlet,
373
<A HREF="../../../../org/apache/struts/action/ActionMapping.html">ActionMapping</A> mapping,
374
<A HREF="../../../../org/apache/struts/action/ActionForm.html">ActionForm</A> form,
375
javax.servlet.ServletRequest request,
376
javax.servlet.ServletResponse response)</CODE>
379
<B>Deprecated.</B> <I>Use the new perform() method without a servlet argument</I></TD>
381
<TR BGCOLOR="white" CLASS="TableRowColor">
382
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
383
<CODE>protected void</CODE></FONT></TD>
384
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#resetToken(javax.servlet.http.HttpServletRequest)">resetToken</A></B>(javax.servlet.http.HttpServletRequest request)</CODE>
387
Reset the saved transaction token in the user's session.</TD>
389
<TR BGCOLOR="white" CLASS="TableRowColor">
390
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
391
<CODE>protected void</CODE></FONT></TD>
392
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#saveErrors(javax.servlet.http.HttpServletRequest, org.apache.struts.action.ActionErrors)">saveErrors</A></B>(javax.servlet.http.HttpServletRequest request,
393
<A HREF="../../../../org/apache/struts/action/ActionErrors.html">ActionErrors</A> errors)</CODE>
396
Save the specified error messages keys into the appropriate request
397
attribute for use by the <struts:errors> tag, if any messages
400
<TR BGCOLOR="white" CLASS="TableRowColor">
401
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
402
<CODE>protected void</CODE></FONT></TD>
403
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#saveToken(javax.servlet.http.HttpServletRequest)">saveToken</A></B>(javax.servlet.http.HttpServletRequest request)</CODE>
406
Save a new transaction token in the user's current session, creating
407
a new session if necessary.</TD>
409
<TR BGCOLOR="white" CLASS="TableRowColor">
410
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
411
<CODE>protected void</CODE></FONT></TD>
412
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#setLocale(javax.servlet.http.HttpServletRequest, java.util.Locale)">setLocale</A></B>(javax.servlet.http.HttpServletRequest request,
413
java.util.Locale locale)</CODE>
416
Set the user's currently selected Locale.</TD>
418
<TR BGCOLOR="white" CLASS="TableRowColor">
419
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
420
<CODE> void</CODE></FONT></TD>
421
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#setServlet(org.apache.struts.action.ActionServlet)">setServlet</A></B>(<A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A> servlet)</CODE>
424
Set the controller servlet instance to which we are attached (if
425
<code>servlet</code> is non-null), or release any allocated resources
426
(if <code>servlet</code> is null).</TD>
428
<TR BGCOLOR="white" CLASS="TableRowColor">
429
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
430
<CODE>protected java.lang.String</CODE></FONT></TD>
431
<TD><CODE><B><A HREF="../../../../org/apache/struts/action/Action.html#toHex(byte[])">toHex</A></B>(byte[] buffer)</CODE>
434
Convert a byte array to a String of hexadecimal digits and return it.</TD>
437
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
438
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
439
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
440
<TD><B>Methods inherited from class java.lang.Object</B></TD>
442
<TR BGCOLOR="white" CLASS="TableRowColor">
443
<TD><CODE><clinit>, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait</CODE></TD>
449
<!-- ============ FIELD DETAIL =========== -->
451
<A NAME="field_detail"><!-- --></A>
452
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
453
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
454
<TD COLSPAN=1><FONT SIZE="+2">
455
<B>Field Detail</B></FONT></TD>
459
<A NAME="DATA_SOURCE_KEY"><!-- --></A><H3>
462
public static final java.lang.String <B>DATA_SOURCE_KEY</B></PRE>
464
<DD>The context attributes key under which our <strong>default</strong>
465
configured data source (which must implement
466
<code>javax.sql.DataSource</code>) is stored,
467
if one is configured for this application.</DL>
470
<A NAME="ERROR_KEY"><!-- --></A><H3>
473
public static final java.lang.String <B>ERROR_KEY</B></PRE>
475
<DD>The request attributes key under which your action should store an
476
<code>org.apache.struts.action.ActionErrors</code> object, if you
477
are using the corresponding custom tag library elements.</DL>
480
<A NAME="EXCEPTION_KEY"><!-- --></A><H3>
483
public static final java.lang.String <B>EXCEPTION_KEY</B></PRE>
485
<DD>The request attributes key under which Struts custom tags might store a
486
<code>Throwable</code> that caused them to report a JspException at
487
runtime. This value can be used on an error page to provide more
488
detailed information about what really went wrong.</DL>
491
<A NAME="FORM_BEANS_KEY"><!-- --></A><H3>
494
public static final java.lang.String <B>FORM_BEANS_KEY</B></PRE>
496
<DD>The context attributes key under which our
497
<code>org.apache.struts.action.ActionFormBeans</code> collection
498
is normally stored, unless overridden when initializing our
502
<A NAME="FORWARDS_KEY"><!-- --></A><H3>
505
public static final java.lang.String <B>FORWARDS_KEY</B></PRE>
507
<DD>The context attributes key under which our
508
<code>org.apache.struts.action.ActionForwards</code> collection
509
is normally stored, unless overridden when initializing our
513
<A NAME="LOCALE_KEY"><!-- --></A><H3>
516
public static final java.lang.String <B>LOCALE_KEY</B></PRE>
518
<DD>The session attributes key under which the user's selected
519
<code>java.util.Locale</code> is stored, if any. If no such
520
attribute is found, the system default locale
521
will be used when retrieving internationalized messages. If used, this
522
attribute is typically set during user login processing.</DL>
525
<A NAME="MAPPING_KEY"><!-- --></A><H3>
528
public static final java.lang.String <B>MAPPING_KEY</B></PRE>
530
<DD>The request attributes key under which our
531
<code>org.apache.struts.ActionMapping</code> instance
535
<A NAME="MAPPINGS_KEY"><!-- --></A><H3>
538
public static final java.lang.String <B>MAPPINGS_KEY</B></PRE>
540
<DD>The context attributes key under which our
541
<code>org.apache.struts.action.ActionMappings</code> collection
542
is normally stored, unless overridden when initializing our
546
<A NAME="MESSAGES_KEY"><!-- --></A><H3>
549
public static final java.lang.String <B>MESSAGES_KEY</B></PRE>
551
<DD>The context attributes key under which our application resources are
552
normally stored, unless overridden when initializing our ActionServlet.</DL>
555
<A NAME="MULTIPART_KEY"><!-- --></A><H3>
558
public static final java.lang.String <B>MULTIPART_KEY</B></PRE>
560
<DD>The request attributes key under which our multipart class is stored.</DL>
563
<A NAME="SERVLET_KEY"><!-- --></A><H3>
566
public static final java.lang.String <B>SERVLET_KEY</B></PRE>
568
<DD>The context attributes key under which we store the mapping defined
569
for our controller serlet, which will be either a path-mapped pattern
570
(<code>/action/*</code>) or an extension mapped pattern
571
(<code>*.do</code>).</DL>
574
<A NAME="TRANSACTION_TOKEN_KEY"><!-- --></A><H3>
575
TRANSACTION_TOKEN_KEY</H3>
577
public static final java.lang.String <B>TRANSACTION_TOKEN_KEY</B></PRE>
579
<DD>The session attributes key under which our transaction token is
580
stored, if it is used.</DL>
583
<A NAME="defaultLocale"><!-- --></A><H3>
586
protected static java.util.Locale <B>defaultLocale</B></PRE>
588
<DD>The system default Locale.</DL>
591
<A NAME="servlet"><!-- --></A><H3>
594
protected <A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A> <B>servlet</B></PRE>
596
<DD>The controller servlet to which we are attached.</DL>
598
<!-- ========= CONSTRUCTOR DETAIL ======== -->
600
<A NAME="constructor_detail"><!-- --></A>
601
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
602
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
603
<TD COLSPAN=1><FONT SIZE="+2">
604
<B>Constructor Detail</B></FONT></TD>
608
<A NAME="Action()"><!-- --></A><H3>
611
public <B>Action</B>()</PRE>
615
<!-- ============ METHOD DETAIL ========== -->
617
<A NAME="method_detail"><!-- --></A>
618
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
619
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
620
<TD COLSPAN=1><FONT SIZE="+2">
621
<B>Method Detail</B></FONT></TD>
625
<A NAME="getServlet()"><!-- --></A><H3>
628
public <A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A> <B>getServlet</B>()</PRE>
630
<DD>Return the controller servlet instance to which we are attached.</DL>
633
<A NAME="setServlet(org.apache.struts.action.ActionServlet)"><!-- --></A><H3>
636
public void <B>setServlet</B>(<A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A> servlet)</PRE>
638
<DD>Set the controller servlet instance to which we are attached (if
639
<code>servlet</code> is non-null), or release any allocated resources
640
(if <code>servlet</code> is null).<DD><DL>
641
<DT><B>Parameters:</B><DD><CODE>servlet</CODE> - The new controller servlet, if any</DL>
646
<A NAME="perform(org.apache.struts.action.ActionServlet, org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.ServletRequest, javax.servlet.ServletResponse)"><!-- --></A><H3>
649
public <A HREF="../../../../org/apache/struts/action/ActionForward.html">ActionForward</A> <B>perform</B>(<A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A> servlet,
650
<A HREF="../../../../org/apache/struts/action/ActionMapping.html">ActionMapping</A> mapping,
651
<A HREF="../../../../org/apache/struts/action/ActionForm.html">ActionForm</A> form,
652
javax.servlet.ServletRequest request,
653
javax.servlet.ServletResponse response)
654
throws java.io.IOException,
655
javax.servlet.ServletException</PRE>
657
<DD><B>Deprecated.</B> <I>Use the new perform() method without a servlet argument</I>
659
<DD>Process the specified non-HTTP request, and create the corresponding
660
non-HTTP response (or forward to another web component that will create
661
it). Return an <code>ActionForward</code> instance describing where
662
and how control should be forwarded, or <code>null</code> if the
663
response has already been completed.<DD><DL>
664
<DT><B>Parameters:</B><DD><CODE>servlet</CODE> - The ActionServlet instance owning this Action<DD><CODE>mapping</CODE> - The ActionMapping used to select this instance<DD><CODE>actionForm</CODE> - The optional ActionForm bean for this request (if any)<DD><CODE>request</CODE> - The servlet request we are processing<DD><CODE>response</CODE> - The servlet response we are processing<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an input/output error occurs<DD><CODE>javax.servlet.ServletException</CODE> - if a servlet exception occurs</DL>
669
<A NAME="perform(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.ServletRequest, javax.servlet.ServletResponse)"><!-- --></A><H3>
672
public <A HREF="../../../../org/apache/struts/action/ActionForward.html">ActionForward</A> <B>perform</B>(<A HREF="../../../../org/apache/struts/action/ActionMapping.html">ActionMapping</A> mapping,
673
<A HREF="../../../../org/apache/struts/action/ActionForm.html">ActionForm</A> form,
674
javax.servlet.ServletRequest request,
675
javax.servlet.ServletResponse response)
676
throws java.io.IOException,
677
javax.servlet.ServletException</PRE>
679
<DD>Process the specified non-HTTP request, and create the corresponding
680
non-HTTP response (or forward to another web component that will create
681
it). Return an <code>ActionForward</code> instance describing where
682
and how control should be forwarded, or <code>null</code> if the
683
response has already been completed.
685
The default implementation attempts to forward to the HTTP version of
687
<DT><B>Parameters:</B><DD><CODE>mapping</CODE> - The ActionMapping used to select this instance<DD><CODE>actionForm</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.io.IOException</CODE> - if an input/output error occurs<DD><CODE>javax.servlet.ServletException</CODE> - if a servlet exception occurs</DL>
692
<A NAME="perform(org.apache.struts.action.ActionServlet, org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
695
public <A HREF="../../../../org/apache/struts/action/ActionForward.html">ActionForward</A> <B>perform</B>(<A HREF="../../../../org/apache/struts/action/ActionServlet.html">ActionServlet</A> servlet,
696
<A HREF="../../../../org/apache/struts/action/ActionMapping.html">ActionMapping</A> mapping,
697
<A HREF="../../../../org/apache/struts/action/ActionForm.html">ActionForm</A> form,
698
javax.servlet.http.HttpServletRequest request,
699
javax.servlet.http.HttpServletResponse response)
700
throws java.io.IOException,
701
javax.servlet.ServletException</PRE>
703
<DD><B>Deprecated.</B> <I>Use the new perform() method without a servlet argument</I>
705
<DD>Process the specified HTTP request, and create the corresponding
706
HTTP response (or forward to another web component that will create
707
it). Return an <code>ActionForward</code> instance describing where
708
and how control should be forwarded, or <code>null</code> if the
709
response has already been completed.<DD><DL>
710
<DT><B>Parameters:</B><DD><CODE>servlet</CODE> - The ActionServlet instance owning this Action<DD><CODE>mapping</CODE> - The ActionMapping used to select this instance<DD><CODE>actionForm</CODE> - The optional ActionForm bean for this request (if any)<DD><CODE>request</CODE> - The servlet request we are processing<DD><CODE>response</CODE> - The servlet response we are processing<DT><B>Throws:</B><DD><CODE>java.io.IOException</CODE> - if an input/output error occurs<DD><CODE>javax.servlet.ServletException</CODE> - if a servlet exception occurs</DL>
715
<A NAME="perform(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)"><!-- --></A><H3>
718
public <A HREF="../../../../org/apache/struts/action/ActionForward.html">ActionForward</A> <B>perform</B>(<A HREF="../../../../org/apache/struts/action/ActionMapping.html">ActionMapping</A> mapping,
719
<A HREF="../../../../org/apache/struts/action/ActionForm.html">ActionForm</A> form,
720
javax.servlet.http.HttpServletRequest request,
721
javax.servlet.http.HttpServletResponse response)
722
throws java.io.IOException,
723
javax.servlet.ServletException</PRE>
725
<DD>Process the specified HTTP request, and create the corresponding HTTP
726
response (or forward to another web component that will create it).
727
Return an <code>ActionForward</code> instance describing where and how
728
control should be forwarded, or <code>null</code> if the response has
729
already been completed.<DD><DL>
730
<DT><B>Parameters:</B><DD><CODE>mapping</CODE> - The ActionMapping used to select this instance<DD><CODE>actionForm</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.io.IOException</CODE> - if an input/output error occurs<DD><CODE>javax.servlet.ServletException</CODE> - if a servlet exception occurs</DL>
735
<A NAME="generateToken(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
738
protected java.lang.String <B>generateToken</B>(javax.servlet.http.HttpServletRequest request)</PRE>
740
<DD>Generate a new transaction token, to be used for enforcing a single
741
request for a particular transaction.<DD><DL>
742
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The request we are processing</DL>
747
<A NAME="getLocale(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
750
protected java.util.Locale <B>getLocale</B>(javax.servlet.http.HttpServletRequest request)</PRE>
752
<DD>Return the user's currently selected Locale.<DD><DL>
753
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The request we are processing</DL>
758
<A NAME="getResources()"><!-- --></A><H3>
761
protected <A HREF="../../../../org/apache/struts/util/MessageResources.html">MessageResources</A> <B>getResources</B>()</PRE>
763
<DD>Return the message resources for this application.</DL>
766
<A NAME="isCancelled(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
769
protected boolean <B>isCancelled</B>(javax.servlet.http.HttpServletRequest request)</PRE>
771
<DD>Returns <code>true</code> if the current form's cancel button was
772
pressed. This method will check if the cancel button generated by
773
<strong>CancelTag</strong> was pressed by the user in the
774
current request. If true, validation performed by an
775
<strong>ActionForm</strong> validate() method will have been
776
skipped by the controller servlet.<DD><DL>
777
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing<DT><B>See Also: </B><DD><A HREF="../../../../org/apache/struts/taglib/CancelTag.html"><CODE>CancelTag</CODE></A>,
778
<A HREF="../../../../org/apache/struts/action/ValidatingActionForm.html"><CODE>ValidatingActionForm</CODE></A></DL>
783
<A NAME="isTokenValid(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
786
protected boolean <B>isTokenValid</B>(javax.servlet.http.HttpServletRequest request)</PRE>
788
<DD>Return <code>true</code> if there is a transaction token stored in
789
the user's current session, and the value submitted as a request
790
parameter with this action matches it. Returns <code>false</code>
791
under any of the following circumstances:
793
<li>No session associated with this request</li>
794
<li>No transaction token saved in the session</li>
795
<li>No transaction token included as a request parameter</li>
796
<li>The included transaction token value does not match the
797
transaction token in the user's session</li>
799
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing</DL>
804
<A NAME="resetToken(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
807
protected void <B>resetToken</B>(javax.servlet.http.HttpServletRequest request)</PRE>
809
<DD>Reset the saved transaction token in the user's session. This
810
indicates that transactional token checking will not be needed
811
on the next request that is submitted.<DD><DL>
812
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing</DL>
817
<A NAME="saveErrors(javax.servlet.http.HttpServletRequest, org.apache.struts.action.ActionErrors)"><!-- --></A><H3>
820
protected void <B>saveErrors</B>(javax.servlet.http.HttpServletRequest request,
821
<A HREF="../../../../org/apache/struts/action/ActionErrors.html">ActionErrors</A> errors)</PRE>
823
<DD>Save the specified error messages keys into the appropriate request
824
attribute for use by the <struts:errors> tag, if any messages
825
are required. Otherwise, ensure that the request attribute is not
827
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing<DD><CODE>errors</CODE> - Error messages object</DL>
832
<A NAME="saveToken(javax.servlet.http.HttpServletRequest)"><!-- --></A><H3>
835
protected void <B>saveToken</B>(javax.servlet.http.HttpServletRequest request)</PRE>
837
<DD>Save a new transaction token in the user's current session, creating
838
a new session if necessary.<DD><DL>
839
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The servlet request we are processing</DL>
844
<A NAME="setLocale(javax.servlet.http.HttpServletRequest, java.util.Locale)"><!-- --></A><H3>
847
protected void <B>setLocale</B>(javax.servlet.http.HttpServletRequest request,
848
java.util.Locale locale)</PRE>
850
<DD>Set the user's currently selected Locale.<DD><DL>
851
<DT><B>Parameters:</B><DD><CODE>request</CODE> - The request we are processing<DD><CODE>locale</CODE> - The user's selected Locale to be set, or null
852
to select the server's default Locale</DL>
857
<A NAME="toHex(byte[])"><!-- --></A><H3>
860
protected java.lang.String <B>toHex</B>(byte[] buffer)</PRE>
862
<DD>Convert a byte array to a String of hexadecimal digits and return it.<DD><DL>
863
<DT><B>Parameters:</B><DD><CODE>buffer</CODE> - The byte array to be converted</DL>
866
<!-- ========= END OF CLASS DATA ========= -->
869
<!-- ========== START OF NAVBAR ========== -->
870
<A NAME="navbar_bottom"><!-- --></A>
871
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
873
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
874
<A NAME="navbar_bottom_firstrow"><!-- --></A>
875
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
876
<TR ALIGN="center" VALIGN="top">
877
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
878
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
879
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
880
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
881
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
882
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
883
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
887
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
893
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
894
PREV CLASS
895
<A HREF="../../../../org/apache/struts/action/ActionBase.html"><B>NEXT CLASS</B></A></FONT></TD>
896
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
897
<A HREF="../../../../index.html" TARGET="_top"><B>FRAMES</B></A>
898
<A HREF="Action.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
901
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
902
SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
903
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
904
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
907
<!-- =========== END OF NAVBAR =========== -->
910
Copyright � 2000-2001 - Apache Software Foundation