Child pages
  • StrutsDocNewbie
Skip to end of metadata
Go to start of metadata

For the prepopulate should the scope be set to session instead of request. Request would mean that the form bean setup in the Edit action would be replaced with a new instance ?

  <form-beans> 
            ... 
            <-- Registration form bean --> 
            <form-bean name="registrationForm" 
                       type="org.apache.struts.webapp.example.RegistrationForm"/> 
            ... 
        </form-beans> 
        ... 
        <action-mappings> 
            ... 
            <-- Edit user registration --> 
            <action path="/editRegistration" 
                    type="org.apache.struts.webapp.example.EditRegistrationAction" 
                    name="registrationForm" 
                   scope="request" 
                validate="false"/> 
            ... 
            <-- Save user registration --> 
            <action path="/saveRegistration" 
                    type="org.apache.struts.webapp.example.SaveRegistrationAction" 
                    name="registrationForm" 
                   input="registration" 
                   scope="request"/> 
            ... 
        </action-mappings> 

Just an FYI, the documentation for 'validwhen' shows the <var-value> tag as ending with </test>

<field
property="pregnancyTest" depends="validwhen">
<arg0 key="medicalStatusForm.pregnancyTest.label"/>
<var>
<var-name>test</var-name>
<var-value>((((sex == 'm') OR (sex == 'M')) AND (*this* == null)) OR (*this* != null))</test>
</var>
</field>

  • No labels