• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Concatnating value of DTO

 
divya sharma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

In my from I have a 3 text box for SSN no like xxx-xx-xxxx but in database there is only one field. I have written a my validation like this...

String customerSSN;
// validate Numeric value in SSN
customerSSN = dto.getCustomerSSN_1() + dto.getCustomerSSN_2()+ dto.getCustomerSSN_3();
if(customerSSN.trim().length()!= 0 && !Validator.containsNumbers(customerSSN,9)){
errors.add("customerSSN", new ActionMessage("error.SSN.required"));
}

It's working but dont know it looks very weired for me to create a new variable in the validation form. Please suggest me the alternative.

Thanks

Divya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic