• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynavalidatorform is not working.

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dynavalidatorform is not working. even i am not getting any error also. when ever i click on register button it does not displays any validation error messages.

my code in h.jsp page

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="html" uri="WEB-INF/struts-html.tld" %>
<br>
<div style="color:red">
<html:errors/>
</div><br>
<html:form action="/register" focus="fname">

<html:text property="fname" value="" /><br>

<html:text property="lname" value=""/><br>
<html:text property="uname" value=""/><br>
<html:password property="password" value="" /><br>
<html:text property="email" value=""/><br>
<html:text property="mobile" value=""/><br>
<html:text property="qualification" value="" /><br>
<html:text property="doj" value=""/><br>
<html:textarea property="address" value="" /><br>
<html:submit value="Register" />
<html:reset value="Cancel" />
</html:form>
form bean configuration in struts configuration file

<form-bean name="registerform" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="fname" type="java.lang.String" />
<form-property name="lname" type="java.lang.String" />
<form-property name="uname" type="java.lang.String" />
<form-property name="password" type="java.lang.String" />
<form-property name="email" type="java.lang.String" />
<form-property name="mobile" type="java.lang.String" />
<form-property name="qualification" type="java.lang.String" />
<form-property name="doj" type="java.lang.String" />
<form-property name="address" type="java.lang.String" />
</form-bean>
action class configuration in struts configuration file

<action input="/h.jsp" name="registerform" path="/register" type="com.mycompany.myapp.struts.RegisterAction" validate="true">
<forward name="success" path="/h.jsp"/>
<forward name="failure" path="/index.jsp"/>
</action>
in validation.xml file

<form name="registerform">
<field
property="fname"
depends="required">
<arg0 key="error.registerform.fname"/>
</field>
...........
</form>
in this code the action class extends Action class
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic