A
Arun Nair
I have a <html:errors/> defined in a page(Logon.jsp) and in my
LogonForm (extends ActionForm) I have a validate method:
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if ((username == null) || (username.length() < 1))
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("logonForm.username"));
if ((password == null) || (password.length() < 1))
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("logonForm.password"));
return errors;
}
But this method gives me an output like
???en_US.logonForm.username??? ???en_US.logonForm.password???
Can anyone tell me why? My application.properties files contains:
# -- standard errors --
errors.header=<H3><FONT color="red">Validation Error</FONT></H3>You
must correct the following error(s) before proceeding:<UL>
errors.prefix=<LI>
errors.suffix=</LI>
errors.footer=</UL><BR>
# -- validator --
errors.invalid={0} is invalid.
errors.maxlength={0} can not be greater than {1} characters.
errors.minlength={0} can not be less than {1} characters.
errors.range={0} is not in the range {1} through {2}.
errors.double={0} must be an double.
errors.float={0} must be an float.
# -- welcome --
welcome.title=Employment Exchange Application
welcome.heading=Welcome!
logonForm.username=<LI>user name required</LI>
logonForm.password=A password must be entered
--------------------------------------
I first thought that struts was not able to find the
application.properties
file. So, I tried putting the application.properties file in the
WEB-INF/classes/resources folder as well as the WEB-INF/classes
folder.
Neither seems to solve the problem. I have spent 4 days on this but
of on avail.
My struts-config.xml contains the following relevent entries(besides
others):
<message-resources parameter="resource.Application" null="false" />
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathname"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in>
What should I do?
thanks
Arun
(e-mail address removed)
LogonForm (extends ActionForm) I have a validate method:
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if ((username == null) || (username.length() < 1))
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("logonForm.username"));
if ((password == null) || (password.length() < 1))
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("logonForm.password"));
return errors;
}
But this method gives me an output like
???en_US.logonForm.username??? ???en_US.logonForm.password???
Can anyone tell me why? My application.properties files contains:
# -- standard errors --
errors.header=<H3><FONT color="red">Validation Error</FONT></H3>You
must correct the following error(s) before proceeding:<UL>
errors.prefix=<LI>
errors.suffix=</LI>
errors.footer=</UL><BR>
# -- validator --
errors.invalid={0} is invalid.
errors.maxlength={0} can not be greater than {1} characters.
errors.minlength={0} can not be less than {1} characters.
errors.range={0} is not in the range {1} through {2}.
errors.double={0} must be an double.
errors.float={0} must be an float.
# -- welcome --
welcome.title=Employment Exchange Application
welcome.heading=Welcome!
logonForm.username=<LI>user name required</LI>
logonForm.password=A password must be entered
--------------------------------------
I first thought that struts was not able to find the
application.properties
file. So, I tried putting the application.properties file in the
WEB-INF/classes/resources folder as well as the WEB-INF/classes
folder.
Neither seems to solve the problem. I have spent 4 days on this but
of on avail.
My struts-config.xml contains the following relevent entries(besides
others):
<message-resources parameter="resource.Application" null="false" />
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathname"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in>
What should I do?
thanks
Arun
(e-mail address removed)