RE: Validator cannot find message key
Well, problem solved!!! As a last resort, I updated all my jar files (struts.jar, struts-validator.jar etc dated at 06/19/03) with the ones (dated at 06/29/03) from a fresh download of the Struts1.1 binary release. And like a magic, the problem disappeared. Thank you all for the suggestions, Saul > -Original Message- > From: Adam Hardy [mailto:[EMAIL PROTECTED] > Sent: Friday, September 05, 2003 11:16 AM > To: Struts Users Mailing List > Subject: Re: Validator cannot find message key > > > > > > I see you're validating manually in the action. Have you tried doing it > automatically with validate=true in the mapping? > > I'm not saying you have to do it like that, but it should work that way. > You should specify the input attribute in the mapping as well. > > > > On 09/05/2003 03:49 PM Yuan, Saul (TOR-ML) wrote: > > Hi Adam, > > > > The problem happens to both client side (javascript) and serverside. > > Below are the codes for each file: > > > > Struts-config.xml: > > > > > > > type="com.mmi.ratt.emailmanager.message.form.MessageForm" /> > > > > > > > attribute="messageForm" > > name="messageForm" > > path="/createMessageAction" > > scope="session" > > validate="false" > > type="com.mmi.ratt.emailmanager.message.action.CreateMessageAction"> > > > path="/create_message_step2.jsp" /> > > > > > > > > > > > > > > > > > > > > > > CreateMessageAction.java: > > > > // -- validate user input > > ActionErrors errors = messageForm.validate(mapping, > > request); > > > > if(errors != null) > > logger.debug("*** number of validation errors: " > > + errors.size()); > > else > > logger.debug("*** number of validation errors: > > none"); > > > > if (errors != null && !errors.isEmpty()) { > > logger.debug("*** validation error saved"); > > > > saveErrors(request, errors); > > if (messageForm.getPage() == 1) > > return mapping.findForward("input" + > > messageForm.getPage()); > > > > if (messageForm.getPage() == 2) > > return mapping.findForward("input" + > > messageForm.getPage()); > > } > > // -- > > > > > > MessageForm.java: > > > > public class MessageForm extends ValidatorForm implements Serializable { > > > > ... > > > > > > > > BTW, I am able to see the messages when using , but > > the validator just cannot find them, just says "null is required", the > > validator is validating the required fields though. > > > > > > > > Thanks, > > Saul > > > > > >>-Original Message- > >>From: Adam Hardy [mailto:[EMAIL PROTECTED] > >>Sent: Friday, September 05, 2003 4:14 AM > >>To: Struts Users Mailing List > >>Subject: Re: Validator cannot find message key > >> > >> > >> > >> > >> > >>Hi Saul, > >>to try to narrow this down a little, is the problem javascript or > >>server-side, or both? > >> > >>One thing it might be is where you specified your > >>ApplicationResources.properties. It should be something like this in > >>struts-config.xml : > >> > >>>> parameter="org.blacksail.ApplicationResources" > >> factory="org.apache.struts.util.PropertyMessageResourcesFactory" > >> null="true"/> > >> > >>Perhaps it would help if we could see the relevant form-definition in > >>your struts-config as well. > >> > >>Adam > >> > >> > >> > >>On 09/04/2003 10:03 PM Yuan, Saul (TOR-ML) wrote: > >> > >>>Here is what's in the validation.xml file: > >>> > >>> > >>> > >>> > >>> >>>page="1"> > >>> >>>resource="true"/> > >>> > >>> >>>page="1"> > >>> >>>resource=&q
Re: Validator cannot find message key
I see you're validating manually in the action. Have you tried doing it automatically with validate=true in the mapping? I'm not saying you have to do it like that, but it should work that way. You should specify the input attribute in the mapping as well. On 09/05/2003 03:49 PM Yuan, Saul (TOR-ML) wrote: Hi Adam, The problem happens to both client side (javascript) and serverside. Below are the codes for each file: Struts-config.xml: CreateMessageAction.java: // -- validate user input ActionErrors errors = messageForm.validate(mapping, request); if(errors != null) logger.debug("*** number of validation errors: " + errors.size()); else logger.debug("*** number of validation errors: none"); if (errors != null && !errors.isEmpty()) { logger.debug("*** validation error saved"); saveErrors(request, errors); if (messageForm.getPage() == 1) return mapping.findForward("input" + messageForm.getPage()); if (messageForm.getPage() == 2) return mapping.findForward("input" + messageForm.getPage()); } // -- MessageForm.java: public class MessageForm extends ValidatorForm implements Serializable { ... BTW, I am able to see the messages when using , but the validator just cannot find them, just says "null is required", the validator is validating the required fields though. Thanks, Saul -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 4:14 AM To: Struts Users Mailing List Subject: Re: Validator cannot find message key Hi Saul, to try to narrow this down a little, is the problem javascript or server-side, or both? One thing it might be is where you specified your ApplicationResources.properties. It should be something like this in struts-config.xml : Perhaps it would help if we could see the relevant form-definition in your struts-config as well. Adam On 09/04/2003 10:03 PM Yuan, Saul (TOR-ML) wrote: Here is what's in the validation.xml file: ... and in the application resources file: newmessage.label.messageName=Message Name newmessage.label.zone=Distribution Zone newmessage.label.audience=Target Audience ... -Original Message- From: Koni Roth [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 3:56 PM To: Struts Users Mailing List Subject: Re: Validator cannot find message key Paste the faulty part of your validation.xml file maybe we can see some strange things. I had a similar problem and it was only an error in writing... Yuan, Saul (TOR-ML) wrote: Hi, I am using Struts Validator for validating a multi page form, some how the Validator cannot find the messages defined in the application resources. I got the validation error messages like: null is required. I've defined arg0 in the validation.xml file, and the key of arg0 points to a key in the application resource file. I verified that the message can be found through , but why not by the validator? Any ideas what the problem could be? Thanks, Saul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validator cannot find message key
Hi Adam, The problem happens to both client side (javascript) and serverside. Below are the codes for each file: Struts-config.xml: CreateMessageAction.java: // -- validate user input ActionErrors errors = messageForm.validate(mapping, request); if(errors != null) logger.debug("*** number of validation errors: " + errors.size()); else logger.debug("*** number of validation errors: none"); if (errors != null && !errors.isEmpty()) { logger.debug("*** validation error saved"); saveErrors(request, errors); if (messageForm.getPage() == 1) return mapping.findForward("input" + messageForm.getPage()); if (messageForm.getPage() == 2) return mapping.findForward("input" + messageForm.getPage()); } // -- MessageForm.java: public class MessageForm extends ValidatorForm implements Serializable { ... BTW, I am able to see the messages when using , but the validator just cannot find them, just says "null is required", the validator is validating the required fields though. Thanks, Saul > -Original Message- > From: Adam Hardy [mailto:[EMAIL PROTECTED] > Sent: Friday, September 05, 2003 4:14 AM > To: Struts Users Mailing List > Subject: Re: Validator cannot find message key > > > > > > Hi Saul, > to try to narrow this down a little, is the problem javascript or > server-side, or both? > > One thing it might be is where you specified your > ApplicationResources.properties. It should be something like this in > struts-config.xml : > > parameter="org.blacksail.ApplicationResources" > factory="org.apache.struts.util.PropertyMessageResourcesFactory" > null="true"/> > > Perhaps it would help if we could see the relevant form-definition in > your struts-config as well. > > Adam > > > > On 09/04/2003 10:03 PM Yuan, Saul (TOR-ML) wrote: > > Here is what's in the validation.xml file: > > > > > > > > > > > page="1"> > >> resource="true"/> > > > > > page="1"> > >> resource="true"/> > > > > > page="1"> > >> resource="true"/> > > > > ... > > > > > > > > and in the application resources file: > > > > newmessage.label.messageName=Message Name > > newmessage.label.zone=Distribution Zone > > newmessage.label.audience=Target Audience > >... > > > > > > > > > > > >>-Original Message- > >>From: Koni Roth [mailto:[EMAIL PROTECTED] > >>Sent: Thursday, September 04, 2003 3:56 PM > >>To: Struts Users Mailing List > >>Subject: Re: Validator cannot find message key > >> > >> > >> > >> > >> > >>Paste the faulty part of your validation.xml file maybe we can see > > > > some > > > >>strange things. I had a similar problem and it was only an error in > >>writing... > >> > >>Yuan, Saul (TOR-ML) wrote: > >> > >>>Hi, > >>> > >>> > >>> > >>>I am using Struts Validator for validating a multi page form, some > > > > how > > > >>>the Validator cannot find the messages defined in the application > >>>resources. I got the validation error messages like: null is > > > > required. > > > >>>I've defined arg0 in the validation.xml file, and the key of arg0 > > > > points > > > >>>to a key in the application resource file. I verified that the > > > > message > > > >>>can be found through , but why not by the validator? > > > > Any > > > >>>ideas what the problem could be? > >>> > >>> > >>> > >>> > >>> > >>>Thanks, > >>> > >>>Saul > >>> > >>> > >> > >> > >>- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- > struts 1.1 + tomcat 4.1.27 + java 1.4.2 > Linux 2.4.20 RH9 > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator cannot find message key
Hi Saul, to try to narrow this down a little, is the problem javascript or server-side, or both? One thing it might be is where you specified your ApplicationResources.properties. It should be something like this in struts-config.xml : Perhaps it would help if we could see the relevant form-definition in your struts-config as well. Adam On 09/04/2003 10:03 PM Yuan, Saul (TOR-ML) wrote: Here is what's in the validation.xml file: ... and in the application resources file: newmessage.label.messageName=Message Name newmessage.label.zone=Distribution Zone newmessage.label.audience=Target Audience ... -Original Message- From: Koni Roth [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 3:56 PM To: Struts Users Mailing List Subject: Re: Validator cannot find message key Paste the faulty part of your validation.xml file maybe we can see some strange things. I had a similar problem and it was only an error in writing... Yuan, Saul (TOR-ML) wrote: Hi, I am using Struts Validator for validating a multi page form, some how the Validator cannot find the messages defined in the application resources. I got the validation error messages like: null is required. I've defined arg0 in the validation.xml file, and the key of arg0 points to a key in the application resource file. I verified that the message can be found through , but why not by the validator? Any ideas what the problem could be? Thanks, Saul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator cannot find message key
Looks good to me. If you are properly closing the and the I can not see any problem, sorry. Koni Yuan, Saul (TOR-ML) wrote: Here is what's in the validation.xml file: ... and in the application resources file: newmessage.label.messageName=Message Name newmessage.label.zone=Distribution Zone newmessage.label.audience=Target Audience ... -Original Message- From: Koni Roth [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 3:56 PM To: Struts Users Mailing List Subject: Re: Validator cannot find message key Paste the faulty part of your validation.xml file maybe we can see some strange things. I had a similar problem and it was only an error in writing... Yuan, Saul (TOR-ML) wrote: Hi, I am using Struts Validator for validating a multi page form, some how the Validator cannot find the messages defined in the application resources. I got the validation error messages like: null is required. I've defined arg0 in the validation.xml file, and the key of arg0 points to a key in the application resource file. I verified that the message can be found through , but why not by the validator? Any ideas what the problem could be? Thanks, Saul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validator cannot find message key
Here is what's in the validation.xml file: ... and in the application resources file: newmessage.label.messageName=Message Name newmessage.label.zone=Distribution Zone newmessage.label.audience=Target Audience ... > -Original Message- > From: Koni Roth [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 04, 2003 3:56 PM > To: Struts Users Mailing List > Subject: Re: Validator cannot find message key > > > > > > Paste the faulty part of your validation.xml file maybe we can see some > strange things. I had a similar problem and it was only an error in > writing... > > Yuan, Saul (TOR-ML) wrote: > > Hi, > > > > > > > > I am using Struts Validator for validating a multi page form, some how > > the Validator cannot find the messages defined in the application > > resources. I got the validation error messages like: null is required. > > I've defined arg0 in the validation.xml file, and the key of arg0 points > > to a key in the application resource file. I verified that the message > > can be found through , but why not by the validator? Any > > ideas what the problem could be? > > > > > > > > > > > > Thanks, > > > > Saul > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator cannot find message key
Paste the faulty part of your validation.xml file maybe we can see some strange things. I had a similar problem and it was only an error in writing... Yuan, Saul (TOR-ML) wrote: Hi, I am using Struts Validator for validating a multi page form, some how the Validator cannot find the messages defined in the application resources. I got the validation error messages like: null is required. I've defined arg0 in the validation.xml file, and the key of arg0 points to a key in the application resource file. I verified that the message can be found through , but why not by the validator? Any ideas what the problem could be? Thanks, Saul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator cannot find message key
Hi, I am using Struts Validator for validating a multi page form, some how the Validator cannot find the messages defined in the application resources. I got the validation error messages like: null is required. I've defined arg0 in the validation.xml file, and the key of arg0 points to a key in the application resource file. I verified that the message can be found through , but why not by the validator? Any ideas what the problem could be? Thanks, Saul