Home > Guides > Tag Developers Guide > Struts Tags > Tag Reference > Generic Tag Reference > action

Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works.

Description

This tag enables developers to call actions directly from a JSP page by specifying the action name and an optional namespace. The body content of the tag is used to render the results from the Action. Any result processor defined for this action in struts.xml will be ignored, unless the executeResult parameter is specified.

Parameters can be passed to the action using nested param tags.

Placement in context

The action will not be published to the context until the whole tag is evaluated, meaning that inside the body of the tag, the action cannot be accessed, For example:

<s:action var="myAction" name="MyAction" namespace="/">
    Is "myAction" null inside the tag? <s:property value="#myAction == null" />
</s:action>
    Is "myAction" null outside the tag? <s:property value="#myAction == null" />

Will print:
Is "myAction" null inside the tag? true
Is "myAction" null outside the tag? false

Parameters

Dynamic Attributes Allowed:

false
 

Name

Required

Default

Evaluated

Type

Description

executeResultfalsefalsefalseBooleanWhether the result of this action (probably a view) should be executed/rendered
flushfalsetruefalseBooleanWhether the writer should be flush upon end of action component tag, default to true
idfalsefalseStringDeprecated. Use 'var' instead
ignoreContextParamsfalsefalsefalseBooleanWhether the request parameters are to be included when the action is invoked
nametruefalseStringName of the action to be executed (without the extension suffix eg. .action)
namespacefalsenamespace from where tag is usedfalseStringNamespace for action to call
rethrowExceptionfalsefalsefalseBooleanWhether an exception should be rethrown, if the target action throws an exception
varfalsefalseStringName used to reference the value pushed into the Value Stack

Examples