File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Valiadation of Object parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Valiadation of Object parameters" Watch "Valiadation of Object parameters" New topic
Author

Valiadation of Object parameters

Navi Lock
Ranch Hand

Joined: Jul 29, 2003
Posts: 39
Hi Guys,
Have a form which has one parameter as an Object of a class along with the other regular parameters .

Parameter's like Name / Date ... etc can be validated, but
how to validate all the parameters of that object at the same time ??.
That object itself has parameters like Name/ Date to be validated also...


Thanks In advance,
Navi.
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
you can validate anything. Name, Date are objects too. the key thing is WHAT rule do you want to validate your object against, oh and also WHERE do you want to do the validation. perhaps describe your problem in more details you may be able to get some real help.


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
Navi Lock
Ranch Hand

Joined: Jul 29, 2003
Posts: 39
Hi Thanks for responding.
I have a Request Form.The request has a parameter as
1)First Name -- Input Box
2)A customised class Object which has parameters like the First Name (multiple parameters).
I know how to validate the "First Name" in the "Validation.xml" file.
Need to know, if there is a way to do the same ( at the same time / in the same form request)in the validation .xml for the parameters of the object of the (2).

An example would be great..
Thanks,
-Navi
[ October 19, 2005: Message edited by: Navi Navi ]
Navi Lock
Ranch Hand

Joined: Jul 29, 2003
Posts: 39
Cmon guys Help me out..........
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
sorry, i was away for training...
in your case, you can define your form validation properties using the object.propertyName. for example, if your form prop is
<form-property name="requestParams" type="my.custom.Object"/> which contains a 'firstName' field.

your validation definition should be
<field property="requestParams.firstName" depends="..."...> ... </field>. everything else is business as usual.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Valiadation of Object parameters