You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by MULLAGIRI Madhavi <MM...@COVANSYS.COM> on 2002/09/20 18:54:42 UTC

[Newbie]: JSP-Formbean question

Hi,

I need to display multiple records (results of a search), and in each record
I want to set attribute A based on another attribute B from the same record.
I have a taglib available for text fields where one of the properties
accepts attribute B to facilitate the logic to set Attribute A (based on
arrtibute B).
But now, how do I gain a handle on the Attribute B in the logic:iterate ?
I would ideally like to have <%=formbean.getAttributeB()%>
But where would I initialize it ?

Madhavi



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Validator and DynaValidatorForm

Posted by John Nicholas <ja...@mobosplash.com>.
I'm using the DynaForm / Validator stuff for the first time, I've always
written out the Forms and Actions before. Everything seems in place but 
the Validator never catches an error and the submit always succeeds.

from struts-config.xml:

         <form-bean
             name="testbean"
             dynamic="true"
             type="org.apache.struts.validator.DynaValidatorForm">
             <form-property
                 name="tname"
                 type="java.lang.String"/>
             <form-property
                 name="tage"
                 type="java.lang.String"/>
             <form-property
                 name="tphone"
                 type="java.lang.String"/>
          </form-bean>
and
         <action
             path="/testformSubmit"
             name="testbean"
             type="ActionTest"
             input="/WEB-INF/jsp/testform.jsp"
             scope="request"
             parameter="test"
             validate="true" >
           <forward name="success" path="/pages/Welcome.jsp"/>
         </action>

and
   <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
     <set-property property="pathnames" 
value="/WEB-INF/validator-rules.xml,/WEB-INF/validator.xml" />
   </plug-in>



from validation.xml:
     <formset>
	<form name="testbean">
		<field property="tage" depends="required,integer">
		</field>
	</form>
     </formset>


I've tried various things in validation as far as changing up <arg0> 
settings. I'm very unclear on what the <arg#> settings are for though




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>