user2172538
user2172538

Reputation: 11

Action Message and action Error is not forwarding to the different action in struts2.3.12

I am using latest struts 2.3.12 version.

My struts.xml

<action name="*ContractorDetail" class="waid.config.contractor.ContractorDetailAction" method="{1}">
            <result name="ContractorDetailScreen" type="tiles">ShowContractorDetailScreen</result>

            <result type="chain" name="success">
               <param name="actionName">ContractorSummary</param>
               <param name="namespace">/app</param>
            </result>
            <result name="input" type="redirectAction">
                <param name="actionName">ContractorSummary</param>
                <param name="namespace">/app</param>
            </result>
            <result name="error" type="redirectAction">
                <param name="actionName">ContractorSummary</param>
                <param name="namespace">/app</param>
            </result>
            <result name="deleteDependency" type="chain">
                <param name="actionName">ContractorSummary</param>
                <param name="namespace">/app</param>
            </result>
        </action>
        <action name="*ContractorSubmit" class="waid.config.contractor.ContractorSubmitAction" method="{1}">

            <result type="chain" name="success">
               <param name="actionName">modifyContractorDetail</param>
               <param name="namespace">/app</param>
            </result>
            <result name="error" type="tiles">ShowContractorDetailScreen</result>
            <result name="input" type="tiles">ShowContractorDetailScreen</result>
        </action>

In my Submit action i am setting actionMessage and action errorMessage which will forwarded to detailsAction. In previous version of struts(2.1) action message are showing in jsp. But after upgrading to struts 2.3.12 version action message and action error both are not coming in jsp.

Upvotes: 1

Views: 2394

Answers (1)

Andrea Zupo
Andrea Zupo

Reputation: 41

Try add these lines in struts.xml to restore the original behaviour

<constant name="struts.xwork.chaining.copyErrors" value="true"/>
<constant name="struts.xwork.chaining.copyFieldErrors" value="true"/>
<constant name="struts.xwork.chaining.copyMessages" value="true"/>

I took the solution from here: http://struts.apache.org/release/2.3.x/docs/chaining-interceptor.html

Upvotes: 4

Related Questions