Hi, I'm very new to struts 2 and I am trying to use it on a project I am creating for one of my classes. The problem I am having is with the validation framework. The validation I have setup seems to be functioning correctly, except on the client it does not output the messages at all. It prevents the action from being executed, but and returns to the jsp page, but it does not display any messages. My code seems to be consistent with the various tutorials I've read. Any help or suggestions would be greatly appreciated, Here is the code for the jsp, validation.xml, and struts.xml files. The action name is RegistrationAction.java and the file RegistrationAction-validation.xml is placed in the same folder as the action.
Register.jsp <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <title>Registration</title> <s:head theme="ajax" /> </head> <h3>Registration</h3> <body> <s:form action="register" validate="true" namespace="/"> <s:textfield label="User Name" name="username"/> <s:password label="Password" name="password" /> <s:password label="Re-enter Password" name="passwordConf" /> <s:textfield label="First Name" name="firstName" /> <s:textfield label="Last Name" name="lastName" /> <s:textfield label="E-mail Address" name="email" /> <s:textfield label="Re-enter E-mail Address" name="emailConf" /> <s:submit/> <s:reset/> </s:form> </body> </html> RegistrationAction-validation.xml <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> <validators> <field name="username"> <field-validator type="requiredstring"> <message>You must enter a username.</message> </field-validator> <field-validator type="stringlength"> 8 20 true <message>Username must be between 8 and 20 characters.</message> </field-validator> </field> <field name="password"> <field-validator type="requiredstring"> <message>You must enter a password.</message> </field-validator> <field-validator type="stringlength"> 8 20 true <message>Password must be between 8 and 20 characters.</message> </field-validator> <field-validator type="fieldexpression"> <![CDATA[password = passwordConf]]> <message>Password must be the same in both fields.</message> </field-validator> </field> <field name="firstName"> <field-validator type="requiredstring"> <message>You must enter your first name.</message> </field-validator> <field-validator type="regex"> <![CDATA[(\w)* (@) (\w)* (.) (\w{2,3})]]> </field-validator> </field> <field name="lastName"> <field-validator type="requiredstring"> <message>You must enter your last name.</message> </field-validator> <field-validator type="regex"> <![CDATA[([a-z] | [A-Z])*]]> </field-validator> </field> <field name="email"> <field-validator type="requiredstring"> <message>You must enter an email address.</message> </field-validator> <field-validator type="fieldexpression"> <![CDATA[email = emailConf]]> <message>Email must be the same in both fields.</message> </field-validator> <field-validator type="regex"> <![CDATA[([a-z] | [A-Z])*]]> </field-validator> </field> </validators> struts.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="Actions" extends="struts-default" namespace="/"> <action name="start" > <result>/jsp/Login.jsp</result> </action> <action name="login" class="com.BallyhOO.Actions.LoginAction"> <result name="input">/jsp/Login.jsp</result> <result>/jsp/Home.jsp</result> </action> <action name="registration" > <result>/jsp/Register.jsp</result> </action> <action name="register" class="com.BallyhOO.Actions.RegistrationAction"> <result name="input">/jsp/Register.jsp</result> <result>/jsp/Home.jsp</result> </action> <action name="pageCreation" > <result>/jsp/CreatePage.jsp</result> </action> <action name="createPage" class="com.BallyhOO.Actions.PageCreationAction"> <result name="input">/jsp/CreatePage.jsp</result> <result>/jsp/PageSetup.jsp</result> </action> <action name="postCreation" > <result>/jsp/CreatePost.jsp</result> </action> <action name="createPost" class="com.BallyhOO.Actions.PostCreationAction"> <result name="input">/jsp/CreatePost.jsp</result> <result>/jsp/ViewPost.jsp</result> </action> <action name="pageSetup" > <result>/jsp/PageSetup.jsp</result> </action> <action name="setupPage" class="com.BallyhOO.Actions.PageSetupAction"> <result name="input">/jsp/PageSetup.jsp</result> <result>/jsp/ViewPage.jsp</result> </action> </package> </struts> -- View this message in context: http://www.nabble.com/New-User---Problems-with-Validation-tf4934099.html#a14123138 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]