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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Struts validation help

Status
Not open for further replies.

kumar7704

Programmer
Feb 13, 2006
3
US
Hello friends,
I have been working with Java/J2EE development for past several years, but didn't work with struts before. Recently I have been assigned on a project using Struts , hibernate+spring. Hibernate+spring part was easy, with struts most part of development was quick, but coming validations (client & server side) it is taking too much time. I am not sure if I have all the resources, I did read Struts in action, but didn't find lot of help for validation part.

Guys, can you please forward me some useful resources (websites, docs etc) for struts validations, struts based menu etc.

For now, I would request your help for the following problem:
I have a form, with four fields

AmountInUSD (text field)
AmountForeign (text field)
CurrencyType (dropdown)
OtherAmount(text field).

I want to add validation in validation.xml, that does the following

if User selects currencyType = USD, then I should make sure that 'otherAmount' and AmountinUSD should be equal.
else otherAmount and AmountForeign should be equal.

I tried 'validwhen', but I couldn't get it work for above situation.

Any help/suggestio/resources for struts validation, general, tips are greatly appreciated.

Kumar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top