You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Soomar, Muki (R.)" <ms...@ford.com> on 2002/06/13 21:21:24 UTC

Using a resource file for managing Form errors

Problem:
------------
I am trying to use a separate resource file for managing errors coming out of the form validation
in an ActionForm. How do I access this resource file? This is a second resource file defined in my
struts-config.xml file.

Steps taken so far:
-------------------------
1. Defined a Message Resource in the struts-config.xml file as follows:
	<message-resources parameter="com.myDomain.RegistrationFormResources" />

2. Dont have a clue how to utilize this in the ActionForm's Validate method. Tried doing this..

	if ((addressLine_1 == null) || (addressLine_1.length() < 1))
		errors.add("addressLine_1", new ActionError("error.RegistrationForm.addressLine_1.required"));

I checked the archives for finding out the answers, but could not find any.
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33400.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg33035.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31667.html
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg31424.html

Any help will be much appreciated.

Muki Soomar


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>