• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Struts Validator &

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using a DynaValidatorActionForm, you can still perform validation in the validate() method just like a "standard" ActionForm.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic