Date Validation not validating 01/01/2ee0 date in struts 1.2
Hi I am trying to add date validation in validation.xml file, i have it setup as below, it validates properly data entry like 0A/01/2012 or 01/A2/2012 but it makes date 01/01/2ee3 to be a valid date which is clearly not, what am i missing dateFormat MM/dd/ datePattern${dateFormat} Ashish
RE: Validation not validating
Ahh. The doc is a bit misleading. It reads: Validation rules can be specified: 1. Per Action class: in a file named ActionName-validation.xml Should probably be in a file named ActionClassName-validation.xml Thanks! _ Mitch Claborn [EMAIL PROTECTED] -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, October 11, 2007 1:48 PM To: Struts Users Mailing List Subject: RE: Validation not validating --- Mitch Claborn <[EMAIL PROTECTED]> wrote: > Oops. > > Question-validation.xml > public class ActionQuestion extends ActionSupport { If you're gunning for validation based on the action class name then this should be ActionQuestion-validation.xml. d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System for Cedar Creek Software. __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation not validating
--- Mitch Claborn <[EMAIL PROTECTED]> wrote: > Oops. > > Question-validation.xml > public class ActionQuestion extends ActionSupport { If you're gunning for validation based on the action class name then this should be ActionQuestion-validation.xml. d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation not validating
Oops. Question-validation.xml http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";> Username is required Please answer q1 Here are snippets from the action ActionQuestion.java public class ActionQuestion extends ActionSupport { public String execute() throws Exception { System.out.println(this.getClass().getName() + ".execute() start"); log.trace("starting"); System.out.println("q1=" + getQ1()); Question l_question = new Question("this is my question", QuestionType.MULTIPLE_CHOICE); l_question.addAnswer(new Answer("a9", "Answer first")); l_question.addAnswer(new Answer("a1", "Answer 1")); l_question.addAnswer(new Answer("a2", "Answer 2")); l_question.addAnswer(new Answer("a3", "Answer 3")); l_question.addAnswer(new Answer("a4", "Answer 4")); l_question.addAnswer(new Answer("a0", "Answer last")); setQuestion(l_question); HashMap l_map = new HashMap(10); l_map.put("x1", "Answer x1"); l_map.put("x2", "Answer x2"); l_map.put("x3", "Answer x3"); l_map.put("x4", "Answer x4"); l_map.put("x5", "Answer x5"); setMap(l_map); System.out.println(this.getClass().getName() + ".execute() end"); return SUCCESS; } There is no validate() in my action. _ Mitch Claborn [EMAIL PROTECTED] -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, October 11, 2007 1:23 PM To: Struts Users Mailing List Subject: Re: Validation not validating --- Mitch Claborn <[EMAIL PROTECTED]> wrote: > Seems like the validation is not firing. > What am I missing? Without any validation files and / or action files it's kind of hard to say. If you post your validation file (the tutorial uses an XML config) that might be enough; posting your Action file as well will remove one more point where things could go wrong. d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System for Cedar Creek Software. __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation not validating
--- Mitch Claborn <[EMAIL PROTECTED]> wrote: > Seems like the validation is not firing. > What am I missing? Without any validation files and / or action files it's kind of hard to say. If you post your validation file (the tutorial uses an XML config) that might be enough; posting your Action file as well will remove one more point where things could go wrong. d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation not validating
Struts 2.0.9 + Tomcat 6 + Debian Linux I'm not seeing any validation messages when the fields I submit are empty. ?debug=xml does not show any error messages on the stack. Seems like the validation is not firing. What am I missing? I tried to copy everything from the Logon example in the tutorial which works like it should. Struts.xml http://struts.apache.org/dtds/struts-2.0.dtd";> [snip] /Question2.jsp Struts.properties struts.devMode = true struts.url.http.port = 8080 struts.action.extension=html struts.ui.theme=xhtml Question2.jsp <%@ taglib prefix="s" uri="/struts-tags" %> [snip] Mitch Claborn [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]