Ankit Garg wrote:Patrick there isn't enough information available to be able to help you. Provide us with the relevant excerpts from your JSP page where the form is. Also show us the Items class. In the error, setQty([Ljava.lang.String;) means that its looking for a method setQty which takes a String array, are there more than one text fields in your JSP which have the name Qty??
Thanks Garg,
I added two more overload method before your post:
setId(String[] id){...}
setQty(String[] qty){...}
and I added logger inside each method call on Item.class.
The result really surprises me. The setId(String[] id) and setQty(String,qty) are used when I submit string against these fields.
This ugly hack works without exception, but I don't understand why.
I cannot post the code since there are a lot of dependencies, but I used sitemesh to organize different form templates.
This is one of them. Poor enough, I renamed the form name, form id... and result the same.
There is no textfield with same name.
However, this
test is not the main point.
My Main Point is:
How can I prevent the type mismatch problem from the user data being submitted into the interceptor to produce exception.
I am looking for this on internet but it seems nobody cares about this.
What should I do to such validation?
thanks