my dog learned polymorphism*
The moose likes Struts and the fly likes validation error msg with properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation error msg with properties file" Watch "validation error msg with properties file" New topic

validation error msg with properties file

Vish hari

Joined: Jul 21, 2008
Posts: 20
Hi Friends,

I am validating the fields in the formbean validate method. Following is the code for adding errors.

1) errors.add("name", new ActionError("id"));-->
id = UserName is invalid -->
Problem is ActionError cannot be resolved at all, eclipse prompts for create a class 'Action error' in the package org.struts.action.

2) errors.add("UserName",new ActionMessage("errors.required")); -->
errors.required = UserName is invalid -->

In both the ways errors are not printing out.

In struts-config.xml, it was given that <message-resources>.

Please revert back if you know the solution

It is sorta covered in the JavaRanch Style Guide.
subject: validation error msg with properties file
Similar Threads
DispatchAction and Validator
Struts Message resources
ActionError problem in Struts 2.0
Error with validation
HTML:Errors and Validate woes