I couldn't find this in the docs. Where could I find it please ?

Anyway, I finally succeeded.
I had already tried the Prepare interceptor but could'nt make it work as I
wanted. But this time it works !
And I have to say it's a very

So I configured the actions as following :

   <package name="absences" namespace="/absences" extends="struts-default">
       <action name="creerDemandeAbsence"
class="creerDemandeAbsenceAction">
           <interceptor-ref name="defaultStack" />
           <result
name="input">/jsp/absences/creerDemandeAbsence.jsp</result>
           <result
name="success">/jsp/absences/confirmerCreationDemandeAbsence.jsp</result>
       </action>
   </package>

My action class has the following methods :

   public String input() throws Exception {
       return INPUT;
   }

   public String execute() throws Exception {
       demandeAbsence.setMatriculeAuteur(SecurityContextHolder.getContext
().getAuthentication().getName());
       demandeAbsence.setVisa(VisaDemande.VISA_ATTENTE.getValue());
       demandeAbsence.setLignes(new
VOLigneDemandeAbsence[]{getLigneDemandeAbsence()});
       demandeAbsence = getServiceAbsence().createDemande(demandeAbsence);
       return SUCCESS;
   }

   public void prepare() throws Exception {
       this.motifs = getServiceAbsence().getAllMotifsAbsence();
   }

And my form begins as following :

<s:form action="creerDemandeAbsence" id="form1" validate="false"
method="post">

I think my error was that my action class had an "init" method returning
SUCCESS instead of a "input" method returning INPUT.
But I am not sure to understand why it works lol
Can you tell me if there is a specific behaviour with input method or
something like that ?

Thanks

Olivier

Reply via email to