aspose file tools*
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Using Struts Validator & " Watch "Using Struts Validator & " New topic
Author

Using Struts Validator &

Jonathan Goh
Greenhorn

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
Greenhorn

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

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: http://aspose.com/file-tools
 
subject: Using Struts Validator &