struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sachin Lale <>
Subject chain or redirectAction ResultType
Date Mon, 30 May 2011 21:13:34 GMT
I am migrating an application from struts1.1 to struts 2.2.3.  I have 
two action

   1. InstitutuionAction : The purpose is to prepare the data required
      to display and then forward to a Institution.JSP (using tiles)
   2. InstitutionAddEditAction: This action exposed two methods insert,
      update and validate.

The insert and validate method of InstitutionAddEditAction class looks 
like below

public String insert() throws Exception
         return Action.SUCCESS;

public void validate()
             addActionError("<font color=\"red\"> Invalid Name .</font>");


<action name="Institution" method="execute" 
<result name="success" type="tiles">.clinportal.institutionDef</result>
<result name="failure" type="tiles">.clinportal.institutionDef</result>
<result name="access_denied" >/</result>
<action name="InstitutionAddEdit_*" method="{1}" 
<result name="input" type="redirectAction">
<param name="actionName">Institution</param>
<param name="operation">add</param>
<param name="pageOf">pageOfInstitution</param>
<param name="menuSelected">2</param>
<result name="success" type="redirectAction">
<param name="actionName">Institution</param>

After a validation error it is getting redirect to Institution.action 
but not re-populating the data entered by the users obvious reason as 
the request is redirected and not forward. Everything works fine if i 
replace the result type to chain and could populate the Institution name 
(this object is in InstitutionAddEditAction class).

I added a Institution object in InstitutuionAction  class. I tried the 
same scenarion using chain this time. Its worked as well. Is 
ChainInterceptor populating this object?

But is using chain a recommended approach. What is harm in using chain.?

Best regards,

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message