i have done validation in one list box..
its working but for first time only.whenever application loaded.
after that its not working properly...
what can be reason for that??


here is code for that in form .java file ..


public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
System.out.println("In validate method");
if (company_id == null || company_id.trim().equals(""))
{
errors.add("company_id",new ActionError("blank"));
}
if (team_id == null || team_id.trim().equals(""))
{
errors.add("team_id",new ActionError("blank"));
}
}

in jsp file..

<tr>
<td align="left" valign="middle" height="35px" rowspan="0" colspan="0" nowrap="nowrap" class="lable12" width="180px">Company Name</td>
<td align="left" valign="middle">
<html:select property="company_id" onchange="javascript:forall('team_name.jsp?val='+t his.value)">
<html:option value="0">--Select--</html:option>
<%
Connection con;
Statement st;
ResultSet rs;
con=DBConnection.getDBConnection();
st =con.createStatement();
rs=st.executeQuery("select * from table");
while(rs.next())
{
%>
<html:option value="<%=rs.getString("company_id") %>" ><%=rs.getString("company_name") %></html:option>

<%
}

%>


</html:select>
<html:errors property="company_id"/>
</td>
</tr>