This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Using Struts Validator & 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 "Using Struts Validator & " Watch "Using Struts Validator & " New topic

Using Struts Validator &

Jonathan Goh

Joined: Jul 02, 2003
Posts: 6
I try to use Struts Validator. Javascript message (i.e alert message) is always display as blank instead of displaying the expected error message. Pls you advise what had go wrong.
If I use DynActionForms, what do I retrive the parameters in Action beside using request? Unlike using ActionForm, i can validated the parameters in ActionForm.Validated. For DynActionForms, how can I do it beside validate the parameter in Action.Execute.
El Roy Cabildo

Joined: Oct 19, 2002
Posts: 23
this what you are going to do...
in the validator.xml
<form name="loginForm">
<field property="badgeNo"
<arg0 key="app.username.text" />
<field property="password"
depends="required" >
<arg0 key="app.password.text" />

in your message resource you put this properties....
errors.required={0} is required.
app.password.text = Password
app.username.text = Username
if an error accured, the {0} will be replaced by the key in arg0 tag.
Gary Mann
Ranch Hand

Joined: Jun 05, 2003
Posts: 37
Using a DynaValidatorActionForm, you can still perform validation in the validate() method just like a "standard" ActionForm.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Using Struts Validator &
Similar Threads
validate() Method in action form
client side validation in struts1.0
validation and error handling
Change Component Style on Validation
Can any one tell me how to use validator plugin in struts ?