why not server side? with ActionForm and validate?

jsp:
=====
<form:form action="chart.do" method="get" >
<tr>
<td  colspan="2"><font color="red"><html:errors property="datumFrom"
/></font></td>
</tr>
<tr>
<td>Datum von: </td>
<td><form:text property="from" size="15"/></td>
<tr>
...

the form bean:
=====

public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
            ActionErrors errors = new ActionErrors();
            
            if (from == null || from.length() == 0 || blabla = blubb) {
              errors.add("datumFrom", new
ActionError("error.filter.datum")); 
            }
            return errors;
        }

and the struts config:
====================

  <action path="/chart" 
                type="di.workerClient.action.ActionFilter" 
                name="filter"
                scope="request"    
==>    when failure return to form      :       input="/cstree/content.jsp"
<==
                validate="true" >
                <forward name="view" path="/cstree/chartcontent.jsp" />
                <forward name="fehler" path="/cstree/content.jsp" />
        </action>


juraj

-----Ursprüngliche Nachricht-----
Von: Julia Yang [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 10. September 2001 19:33
An: [EMAIL PROTECTED]
Betreff: Example to use javascript to validate field input in JSP not
null and be integer ?


 
All
Does anybody can give me a small Example or explanation on how to use
javascript to validate field input in JSP not null and be integer ?
 
 
Thanks
Julia
 

Reply via email to