I can't believe how much problem I've been having with the
struts validator framework! I can get NOTHING to work and have spent HOURS on this! I've read about 4 online tutorials, went through 3 textbooks and it's still not working.
Any help would be appreciated. Here is my DIRT SIMPLE example that DOESN'T work.... Grrrrrr....
-- struts-config.xml --
<form-bean name="TestForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="email" type="java.lang.String"/>
</form-bean>
.
.
.
<action path="/TestAction"
type="mypack.TestAction"
name="TestForm"
input="/test.jsp">
<forward name="GOOD" path="/thankyou.jsp"/>
</action>
-- validation.xml --
<form name="TestForm">
<field-property name="email" depends="required"/>
</form>
-- my test.jsp --
<%@ include file="/WEB-INF/taglibs.jsp" %>
<HTML><HEAD><TITLE>
Test page</TITLE></HEAD>
<BODY>
<H1>test page</H1>
<P>
Errors start
<BR>
<html:errors/>
Errors end
<P>
<html:form action="/TestAction">
Your email: <html:text property="email"/><P>
<html:submit/>
</html:form>
</BODY></HTML>
*************************
Note: the WEB-INF/taglibs.jsp contains taglib declarations for all struts taglibs. (This is the ONE thing that actually works in this project of mine). Also the action class does nothing but return the "GOOD"
string. (It SHOULDN'T do anything, right? The validation framework is automatic, right?)
So, I boot my server and ensure that both validation XMLs are loaded. Then go into my input page, just push the submit without filling in the email section to test the validation. I am immediately ushered to the "Thank you for the valid data" screen.
What is wrong here? I've seen about 8 posts via google about people having problems with this, but not one answer. I'm to the point where I now believe that the validation framework is vaporware!
[ July 13, 2003: Message edited by: Jason Kosowan ]