It's not a secret anymore!*
The moose likes Struts and the fly likes Problem in Validating array of form field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem in Validating array of form field " Watch "Problem in Validating array of form field " New topic
Author

Problem in Validating array of form field

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

HI ranchers,
I am having JSP form with two text field one is Name : and other is Email :
I am displaying it more than one time like , on single page it appears as ;

Name : ---- Email :---
Name : ---- Email :---
Name : ---- Email :--- SUBMIT

And in my form bean i store them with String[] array.
like private String[] name; and String[] email;

Now i write validation for this form in validation.xml as



Now when my validation fails, an error message get printed on top of page but , the input box of Name: and Email : contains a hashcode of String []. like [Ljava.lang.String;@14c01ac..

How can i remove this hashcode value , and put the same Name or email into text field which is same as before submitting ??

Thanks in advance !


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Can anyone tell me How to use 'indexedListProperty' field in validation.xml ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in Validating array of form field
 
Similar Threads
validator plugin and validate() method needs to use together
Email validation does not work
Struts 1.2 retaininf form fields in jsp in validation error
struts validation
Validation of indexed properties