Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help! Which propery name we use in <html:errors> for DynaValidatorForm 1

Status
Not open for further replies.

jollyplay

Programmer
Dec 16, 2003
90
Hello,

I have to display the <html:errors> message in different place in form accoring to propery, not in same place.

------------------------------------------------------------Using PhysicalFormBean it is working fine. i use like that
In ActionForm
-------------
ActionErrors errors = new ActionErrors();
errors.add(&quot;userId&quot;, new ActionError(&quot;error.no.userId&quot;));
In JSP
------
<html:errors property=&quot;userId&quot;/>
------------------------------------------------------------
My Problem in DynaValidatorForm.
Now what my problem is, what propery i give in <html:errors> tag for
DynaValidatorForm i tried many ways. All are vain.

Please help me with example or any link. Thanks in advance,

With regards,
balachandar.
 
should be the form-poperty name you define in the struts config file for.

For example, if you have a form-bean defined as:

<form-bean name=&quot;messageForm&quot; type=&quot;org.apache.struts.validator.DynaValidatorForm&quot;>
<form-property name=&quot;name&quot; type=&quot;java.lang.String&quot; />
<form-property name=&quot;message&quot; type=&quot;java.lang.String&quot; />
</form-bean>

say you have validation rules for both name and message properties, then error respectively messages wold be

<html:errors proprty=&quot;name&quot;/>
and
<html:errors proprty=&quot;message&quot;/>

 
Dear byam,

It is working fine, Thank you for your help.

With regards,
balachandar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top