Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

validation error msg with properties file

 
Greenhorn
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

Thanks,
Vishnuvardhan
 
Don't touch me. And dont' touch this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic