struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jerry Jalenak" <>
Subject RE: how do i get a Field object in Validator?
Date Tue, 22 Oct 2002 18:18:42 GMT
In your validator-rules.xml file, add the following for each form field you
need access to:

	<form name="yourForm">
		<field property="firstProperty" depends="yourCustomRoutine">

secondProperty-Label would be what you want to call the variable in your
custom routine; secondProperty-Value would be the actual form field name
that contains the entered value.  Then in your custom routine you can access
these values by

	public static boolean yourCustomRoutine(Object object,
ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest
		String fp = ValidatorUtil.getValueAsString(object,
		String sp = ValidatorUtil.getValueAsString(object,

		... do something ...
		return true;  // or false if the validation fails



> -----Original Message-----
> From: Andy Kriger []
> Sent: Tuesday, October 22, 2002 11:33 AM
> To: Struts Users Mailing List
> Subject: how do i get a Field object in Validator?
> I am writing a custom rule and I need to know how I can get a 
> handle to a
> different Field object? (not the one passed into the method 
> in the first
> place)
> thx
> a
> --
> To unsubscribe, e-mail:   
> <>
> For additional commands, e-mail: 
> <>

This transmission (and any information attached to it) may be confidential and is intended
solely for the use of the individual or entity to which it is addressed. If you are not the
intended recipient or the person responsible for delivering the transmission to the intended
recipient, be advised that you have received this transmission in error and that any use,
dissemination, forwarding, printing, or copying of this information is strictly prohibited.
If you have received this transmission in error, please immediately notify LabOne at (800)388-4675.

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message