• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

DynaActionForm Bean Validation

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I'm using DynaActionFrom. I have the ff: form-bean:
I'm not sure how will i configure the validation in validation.xml.
Please help.

<form-bean name="applicantForm"
<form-property name="education" type="com.rms.struts.model.ApplicantEducation[]" size="3" />
</form-bean>

Here is my initial configuration. But it doesnt work.

<field property="education" page="2" indexedListProperty="nameOfSchool" depends="required">


Here is my Bean:

public class ApplicantEducation {

private Integer applicantID;
private Integer levelID;
private String nameOfSchool;
private String schoolAddress;
private Integer yearGraduated;
private String degree;
private String educationLevel;

}

thanks a lot.
<arg key="applicantForm.nameOfSchool"/>
</field>
 
yan yan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correction :

<field property="education" page="2" indexedListProperty="nameOfSchool" depends="required">
<arg key="applicantForm.nameOfSchool"/>
</field>
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The page attribute should only be used if your form has multiple pages and you have a hidden field named "page" set to "2" on this form. If this is not the case, I'd suggest you remove the page attribute.

If this doesn't solve the problem, please post the relevant portions of your JSP.
 
yan yan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Merill,

Thanks.I already solved the problem. Yes i needed, the page attribute because i have multiple JSP that points to one action class. In the "indexedListProperty" attribute,i put the bean collection name (education) and the bean property in the "property" attribute - (nameOfSchool).


-----------------
Struts-Config.xml
-----------------
<form-bean name="applicantForm" type="org.apache.struts.validator.DynaValidatorForm" extends="baseForm">

<form-property name="education" type="com.rms.struts.model.ApplicantEducation[]" size="3" />


--------------
Validation.xml
--------------
<field property="nameOfSchool" page="2" indexedListProperty="education" depends="required">
<arg key="prompt.nameOfSchool"/>
</field>

Thanks a lot = )
ianne
 
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic