File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Concatnating value of DTO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Concatnating value of DTO" Watch "Concatnating value of DTO" New topic

Concatnating value of DTO

divya sharma
Ranch Hand

Joined: Jan 25, 2007
Posts: 87

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.



I agree. Here's the link:
subject: Concatnating value of DTO
Similar Threads
How to combine JSP <c:if> with JSF <f:validateLength>
what is the good/standard way to inform client the parameter restriction/fomat
Problems w/ a HashMap
randomly pick 12 items with no duplicates
Validations Spanning Multiple Pages