See below > -----Original Message----- > From: Samuel Mota [mailto:[EMAIL PROTECTED] > Sent: Thursday, August 28, 2003 2:18 PM > To: [EMAIL PROTECTED] > Subject: RE: [OS-webwork] Validation Framework doubt > > > > Hi Jason, guys, > > Now the interceptor is working ... or should be working. The > problems that I wasn't able to see the errors was that my > interceptor declaration at xwork.xml was incorrect and I was > getting tons of exceptions (and can't pay attention at all) >
Which errors were you not seeing? Were they being logged by WW? If not, create a Jira issue... We need to make sure the information developers need is logged. > Now I'm almost validating ... but I'm getting the error: > 28/08/2003 14:54:32 > com.opensymphony.xwork.validator.ValidatorFileParser$2 error > SEVERE: Document is invalid: no grammar found. at (2:12) > 28/08/2003 14:54:32 > com.opensymphony.xwork.validator.ValidatorFileParser$2 error > SEVERE: Document root element "validators", must match > DOCTYPE root "null". at (2:12) This sounds like it's a problem with your DTD declaration > > What are the ValidatorFileParser complaining about? > > my validator.xml is empty without DOCTYPE declaration (only > the few validators/validator xml tags) It should be validators.xml and it should be in the root of your classpath, right? > and > myaction-validation.xml has <!DOCTYPE validators PUBLIC > "-//OpenSymphony Group//XWork Validator 1.0//EN" > > "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd"> This looks correct. > > The problem is that I'm getting my error messages no matter > which values I set at my fields ... > > I'm using the fields name not the label, like this: > > <webwork:textfield label="Célula Técnica" name="celulaTecnica"/> > > <field name="celulaTecnica"> > <field-validator type="required"> > <message>O número da célula técnica é exigido!</message> > </field-validator> > <field-validator type="int"> > <param name="min">1</param> > <param name="max">999999</param> > <message>Célula técnica inválida!</message> > </field-validator> > </field> > > And after submit the filled fields are empty instead of > maintaining the posted value. > If the field value can't be converted to the type (int in this case?) then it won't show up in the field afterwards (since it pulls the data for the form from the property) > what is the problem(s)? thanks ... > Another thing to look at is the name of your validator file. Make sure it's ClassName-validation.xml (and make sure the Capitalization of the class name is the same as the file name). > + Samuel G. Mota > + [EMAIL PROTECTED] > + 55 (11) 4417 7093 > + Business Application Dpt. > + Netset Serviços em Tecnologia > + a Hypercom Company > + http://www.hypercom.com > > > > > > [EMAIL PROTECTED] > > > Sent by: > To: [EMAIL PROTECTED] > > [EMAIL PROTECTED] > cc: > > ceforge.net > Subject: RE: [OS-webwork] Validation Framework doubt > > > > > > > > 28/08/2003 10:34 > > > Please respond to > > > opensymphony-webwork > > > > > > > > > > > > > Hmm... Are your validations down in the "actions" package of > your Action? You said only that it was in > "br.com.company.app". It needs to find the validations for > your Action to apply them. > > The other problem is the stuff Mike CB checked in a long time ago :-) > > He implemented what DefaultWorkflowInterceptor does in > ActionSupport and moved what was ActionSupport down to > BaseActionSupport. Creating the DefaultWorkflowInterceptor > was the first of a 2 part process, the second of which is to > undo this change (sorry Mike). If you override execute() > instead of doExecute() you will see the errors, otherwise it > will return "input" without running your Action. Of course, > the DefaultWorkflowInterceptor does this too, so you won't > even get to the Action execute() method... > > I should have taken care of this earlier, but didn't want to > piss anyone off. As a general rule, I don't want ANY logic in > ActionSupport and anything, like this, that are applying > logic to Actions should be implemented as Interceptors so > they can be applied to any Actions, not just the ones > extending ActionSupport. > > Expect to see this change and doExecute() go away. > > > -----Original Message----- > > From: Samuel Mota [mailto:[EMAIL PROTECTED] > > Sent: Thursday, August 28, 2003 9:10 AM > > To: [EMAIL PROTECTED] > > Subject: RE: [OS-webwork] Validation Framework doubt > > > > > > > > Hi, > > > > >map of fieldErrors. It WILL NOT stop execution just because > > you have an > > >error. You can apply the DefaultWorkflowInterceptor after the > > >validation to have it automatically return "input" if you have > > any errors >applied to your Action. Otherwise, you can > decide how to > > deal with them in your execute > > () method. > > > > I've added the DefaultWorkflowInterceptor to my interceptors > > list: <interceptor > > class="com.opensymphony.xwork.interceptor.DefaultWorkflowInter > > ceptor" name ="workflowinterceptor"/> > > > > And my action is as follow: > > <action class="br.com.company.app.actions.UserLogin" name="login"> > > <interceptor-ref name="validator"/> > > <interceptor-ref name="workflowinterceptor"/> > > <result name="error" type="dispatcher"> > > <param name="location">/index.jsp</param> > > </result> > > <result name="input" type="dispatcher"> > > <param name="location">/index.jsp</param> > > </result> > > <result name="success" type="dispatcher"> > > <param name="location">/app.jsp</param> > > </result> > > <interceptor-ref name="defaultStack"/> > > </action> > > > > Added UserLogin-validation.xml to my br.com.company.app package ... > > > > But at my doExecute() method I have no errors > > (this.validationAware.actionErrors and .fieldErrors = > > null) > > > > What am I missing? > > > > (I've posted the interceptor stuff to you guys correct me > If something > > is wrong on this approach:) > > > > thanks > > > > + Samuel G. Mota > > + [EMAIL PROTECTED] > > + 55 (11) 4417 7093 > > + Business Application Dpt. > > + Netset Serviços em Tecnologia > > + a Hypercom Company > > + http://www.hypercom.com > > > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by:ThinkGeek > > Welcome to geek heaven. > > http://thinkgeek.com/sf > > _______________________________________________ > > Opensymphony-webwork mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork