wood burning stoves 2.0*
The moose likes Struts and the fly likes validation in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation in struts" Watch "validation in struts" New topic
Author

validation in struts

Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189
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

Joined: Sep 29, 2008
Posts: 12617

Which version of Struts?
Deeps Mistry
Ranch Hand

Joined: Jan 31, 2009
Posts: 189
David Newton wrote:Which version of Struts?


Hi,

Struts 1.1
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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().
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validation in struts