You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Arnaud Gadby <ar...@eileo.com> on 2003/04/17 14:01:55 UTC

RE : navigation and forms

It means that I have to create a new action each time I need to display
a form ?
I used reset() to initialize form values.

Arnaud

-------------------------------------------
Arnaud GADBY                       

EILEO
9ter rue Carnot
94270 Le Kremlin Bicetre
FRANCE

-----Message d'origine-----
De : julian green [mailto:julian.green@jacobsrimell.com] 
Envoyé : jeudi 17 avril 2003 13:45
À : Struts Users Mailing List
Objet : Re: navigation and forms

You can generate an action that does nothing, and go straight the the 
action (http://localhost:8080/mywebapp/init.do). The action returns 
success and forwards to the jsp page.   We do something simillar to 
initialize form values.

     <action
             path="init"
             type="com.struts.provisioning.InitAction"
             name="ProvisioningForm"
             scope="session"
             validate="false"
             parameter="This gets passed to action">
            
             <forward name="success"
path="/jsp/provisioning/details.jsp"/>
     </action>

Julian


Arnaud Gadby wrote:

>Hi ! 
>
>I'm planning to use Struts in my Web Site. I've done a first
application
>but there's something I don't understand about struts navigation when
>using form. 
>
>My first application is a simple registration : 
>
>>>From a link, the user can go to registration.jsp
>When all validations are ok, the registrationAction is done. 
>At this point it's working. 
>
>My problem is : I don't want the link to go to registration.jsp (I
don't
>want any link to go to anyPage.jsp). 
>
>Do I have to add an other action like displayRegistrationForm.do which
>only display registration.jsp ? 
>
>NB : I've tried to make the link go directly to registrationAction but
>it displays error messages for non-validated fields :-( 
>
>Thanks
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.471 / Virus Database: 269 - Release Date: 10/04/2003
> 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.471 / Virus Database: 269 - Release Date: 10/04/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.471 / Virus Database: 269 - Release Date: 10/04/2003
 


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: RE : navigation and forms

Posted by julian green <ju...@jacobsrimell.com>.
Yes, but you can reuse the action code.    Either have an empty action 
that always returns success, or use the parameter attribute of the 
action in struts-config.xml to signal to the action class to do the 
reset.  

Dont use reset() of the form to reset values, you will find that strutts 
calls it more often than you think.   reset() method is used to reset 
values of checkboxes prior to parsing the browsers request.

Julian

Arnaud Gadby wrote:

>It means that I have to create a new action each time I need to display
>a form ?
>I used reset() to initialize form values.
>
>Arnaud
>
>-------------------------------------------
>Arnaud GADBY                       
>
>EILEO
>9ter rue Carnot
>94270 Le Kremlin Bicetre
>FRANCE
>
>-----Message d'origine-----
>De : julian green [mailto:julian.green@jacobsrimell.com] 
>Envoyé : jeudi 17 avril 2003 13:45
>À : Struts Users Mailing List
>Objet : Re: navigation and forms
>
>You can generate an action that does nothing, and go straight the the 
>action (http://localhost:8080/mywebapp/init.do). The action returns 
>success and forwards to the jsp page.   We do something simillar to 
>initialize form values.
>
>     <action
>             path="init"
>             type="com.struts.provisioning.InitAction"
>             name="ProvisioningForm"
>             scope="session"
>             validate="false"
>             parameter="This gets passed to action">
>            
>             <forward name="success"
>path="/jsp/provisioning/details.jsp"/>
>     </action>
>
>Julian
>
>
>Arnaud Gadby wrote:
>
>  
>
>>Hi ! 
>>
>>I'm planning to use Struts in my Web Site. I've done a first
>>    
>>
>application
>  
>
>>but there's something I don't understand about struts navigation when
>>using form. 
>>
>>My first application is a simple registration : 
>>
>>>>From a link, the user can go to registration.jsp
>>When all validations are ok, the registrationAction is done. 
>>At this point it's working. 
>>
>>My problem is : I don't want the link to go to registration.jsp (I
>>    
>>
>don't
>  
>
>>want any link to go to anyPage.jsp). 
>>
>>Do I have to add an other action like displayRegistrationForm.do which
>>only display registration.jsp ? 
>>
>>NB : I've tried to make the link go directly to registrationAction but
>>it displays error messages for non-validated fields :-( 
>>
>>Thanks
>>
>>---
>>Outgoing mail is certified Virus Free.
>>Checked by AVG anti-virus system (http://www.grisoft.com).
>>Version: 6.0.471 / Virus Database: 269 - Release Date: 10/04/2003
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>> 
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.471 / Virus Database: 269 - Release Date: 10/04/2003
> 
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.471 / Virus Database: 269 - Release Date: 10/04/2003
> 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org