- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHi,
I have a requirement for struts validation for a number of text fields which will use the same name. As the number can be up to 50 text boxes, obviously, I want to use the same name.
The name of my text box if firstName[]
Below is my form beans:
package strutspackage;
import org.apache.struts.validato
public class appForm extends ValidatorForm {
private static final long serialVersionUID = 1L;
private String[] firstName;
public String[] getFirstName() {
return this.firstName;
}
public void setFirstName(String[] firstName) {
this.firstName = firstName;
}
}
My validation is a simple 'required' validation:
<field
property="firstName"
depends="mask"
page="1">
<arg key="genericInvalid.amount
<var>
<var-name>mask</var-name>
<var-value>^[0-9]*$</var-v
</var>
</field>
However, when I run this application form, I'm getting errors:
javax.servlet.ServletExcep
org.apache.jasper.runtime.
org.apache.jasper.runtime.
org.apache.jsp.appForm1_js
org.apache.jasper.runtime.
javax.servlet.http.HttpSer
org.apache.jasper.servlet.
org.apache.jasper.servlet.
org.apache.jasper.servlet.
javax.servlet.http.HttpSer
I presume this has something to do with my form class.
I don't have much experience using string array within Struts so if anyone can lend a hand or has previous experience with this, it would be much appreciated.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: gibu_georgePosted on 2009-04-07 at 10:34:21ID: 24089827
Try this
iew.jsp?EI D=915898
http://www.jguru.com/faq/v