<field name="email_address"> <field-validator type="required"> <message>You cannot leave the email address field empty.</message> </field-validator> <field-validator type="email"> <message>The email address you entered is not valid.</message> </field-validator></field>
<field name="email_address"> <field-validator type="required"> <message>You cannot leave the email address field empty.</message> </field-validator> <field-validator type="email"> <message>The email address you entered is not valid.</message> </field-validator></field>
我现在只会写在execute方法里但是我想写在validate()方法里请问又什么办法嘛?
public String execute()
{
if(email.matches(("^\\w+@\\w+\\.(com|cn)")))
{
return "hzj";
}
else
{
return "email";
}
}