Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validation in struts

 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to validate my form fields. How do i implement it without using Struts Validator framework?

Also, can i write a validate method in my Action Class?

Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of Struts?
 
Deeps Mistry
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Which version of Struts?


Hi,

Struts 1.1
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, wow.

You *can* write validation in your action, but it's a bit unwieldy in 1.1, IIRC (it's been awhile). If you're not doing *any* validation in the ActionForm/etc. then you should just be able to create an ActionErrors, add errors to it, and use saveErrors().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic