• Post Reply Bookmark Topic Watch Topic
  • New Topic

validation error msg with properties file  RSS feed

Vish hari
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"));--> logonForm.java
id = UserName is invalid --> ApplicationResources.properties
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")); --> logonForm.java
errors.required = UserName is invalid --> messageresources.properties

In both the ways errors are not printing out.

In struts-config.xml, it was given that <message-resources parameter=com.org.resorces.ApplicationResources>.

Please revert back if you know the solution

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!