File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes  html:errors tag not displaying errors :-( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark " html:errors tag not displaying errors :-(" Watch " html:errors tag not displaying errors :-(" New topic

html:errors tag not displaying errors :-(

Rahul Kakkar
Ranch Hand

Joined: Apr 17, 2005
Posts: 70
ello All,

When I attempt to display my ActionErrors (created in the validate method) I get the <li> </li> tags (dot) but, the error message is not displayed.
I checked the classes directory to ensure that the file was there and it is.....HELP
errors.header=<font color="red"><h2>Error!</h2><UL>

prompt.db.driver=JDBC Driver
prompt.db.url=JDBC URL
prompt.db.query=SQL Query
error.required={0} is mandatory SELECT query is allowed


<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE form-validation PUBLIC
"-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
<form name="DBInfoForm">
<field property="driver" depends="required">
<arg0 key="prompt.db.driver"/>
<field property="url" depends="required">
<arg0 key="prompt.db.url"/>
<field property="query" depends="required">
<arg0 key="prompt.db.query"/>





<message-resources parameter="AppMessages"/>
Pranav Sharma
Ranch Hand

Joined: Oct 27, 2003
Posts: 258
try setting the jsp to javascript alerts, and see if the errors are getting detected
Srilakshmi Vara
Ranch Hand

Joined: Jul 21, 2004
Posts: 169
For validation to work

--- check validate tag must set to be true in action mapping class.
--- Your form should extend ValidatorForm.

Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Look at your validator-rules.xml configuration. I'm pretty sure the "required" error message key it expects is errors.required

A good workman is known by his tools.
Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
Marc is right.

your Resource Bundle should be having that entry (errors.required).

I had the same issue sometimes ago ..
[ August 26, 2005: Message edited by: Mohen Vijay ]
I agree. Here's the link:
subject: html:errors tag not displaying errors :-(
It's not a secret anymore!