Grokbase Groups Struts user May 2007
FAQ
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

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 7 | next ›
Discussion Overview
groupuser @
categoriesstruts
postedMay 29, '07 at 1:43p
activeMay 29, '07 at 3:03p
posts7
users3
websitestruts.apache.org
irc#struts

People

Translate

site design / logo © 2021 Grokbase