I am having problem getting Validator plugin to work in a very simple case.
Here is the source code. Can some one tell me what I am doing wrong?
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validator.xml" />
</plug-in>
<form-bean name="SalesProspectForm"
type="com.globallink.glr.dataentryweb.form.AddSalesProspectForm">
</form-bean>
<action path="/AddSalesProspect"
type="com.globallink.glr.dataentryweb.action.AddSalesProspect"
name="SalesProspectForm" scope="request" validate="true"
input="/DisplayAddSalesProspect.do">
</action>
public class AddSalesProspect extends Action
{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
{
return null;
}
}
public class AddSalesProspectForm extends ValidatorForm
{
private String ClientFullName;
public void setClientFullName(String clientFullName)
{
ClientFullName = clientFullName;
}
public String getClientFullName()
{
return ClientFullName;
}
}
<form name="AddSalesProspect">
<field property="clientFullName" depends="required">
<arg0 key="errors.required" />
</field>
</form>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<html>
<HEAD>
<html:base />
<LINK rel="stylesheet"
href="<%=request.getContextPath()%>/theme/global.css" type="text/css"
/>
<LINK rel="stylesheet"
href="<%=request.getContextPath()%>/theme/grp.css" type="text/css" />
</HEAD>
<body>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
<TBODY>
<TR>
<td><html:errors /></td>
</TR>
<TR>
<td width="100%" align="center"><html:form action=
"AddSalesProspect">
<TABLE border="0">
<TBODY>
<TR>
<TD>Client Name</TD>
<TD>Inst Id</TD>
<TD>New/Exist</TD>
<TD>Side</TD>
<TD>Type</TD>
</TR>
<TR>
<TD><html:text property=
"clientFullName" /></TD>
</tr>
<TR>
<td> </td>
</TR>
<TD><html:submit value="Save"
/></TD>
<TD><html:reset value="Reset"
/></TD>
</TR>
</TBODY>
</TABLE>
</html:form></td>
</TR>
</TBODY>
</TABLE>
</body>
</html>
--Mohan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]