This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma 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 Java Interview Guide this week in the Jobs Discussion 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.
I agree. Here's the link:
subject: Using Struts Validator &
jQuery in Action, 3rd edition