File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts validation error message not appearing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts validation error message not appearing" Watch "Struts validation error message not appearing" New topic
Author

Struts validation error message not appearing

Hideki Mae
Greenhorn

Joined: Oct 19, 2004
Posts: 14
To all:
Sytem: JBoss-3.2.4, Tomcat-5.0.26, WindowsXP
I set up a Struts validation and I get the pop-up window but the error message is blank. I can tell the validation is working since the pop-up window will not appear if I enter a correct value. My guess is that I did not set the xml files correctly. However, I don't see what is wrong.
Can anybody help me?

Thanks.

validation.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN" "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
<form-validation >

<formset>
<form name="bdprWkpkgReqDtoActionForm">
<field property="wireCenter" depends="required,mask">
<arg0 key="inputForm.wireCenter"/>
<arg1 key="inputForm.wireCenter"/>
<var>
<var-name>mask</var-name>
<var-value>^\d{6}\d*$</var-value>
</var>
</field>
</form>
</formset>

/*****/
part of struts-config.xml after action-mapping
<message-resources parameter="resources.application" />
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames" value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml" />
</plug-in>

/******/
application.properties file which I put under /WEB-INF/classes/resources
#--Custom messages for this application --
inputForm.wireCenter=WireCenter
#--Standard Errors --
errors.header=<FONT COLOR RED=RED><UL>
errors.prefix=<LI>
errors.suffix=</LI>
errors.footer=</UL></FONT>
#--validator --
errors.required={0} is required.
errors.mask={0} must be a 6-digit number.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60997
    
  65

Moving to Web App Frameworks.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts validation error message not appearing