aspose file tools*
The moose likes Struts and the fly likes Struts Validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Validation" Watch "Struts Validation" New topic
Author

Struts Validation

Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 120
Hello,

On struts validation, is it true that for server-side validation we must extend our actionform with DynaValidatorActionForm or DynaValidatorForm only. Can we also do it with ValidatorForm?

I am new to struts can anyone post a step by step procedure on how to perform validation on server side- if possible with code. Thank you very much in advance.

Lk.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Luke,
Welcome to JavaRanch!

We're pleased to have you here with us in the JStruts forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Please add a last name.

Thanks,
Jeanne
Bartender
[ October 27, 2005: Message edited by: Jeanne Boyarsky ]

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 120
Thanks Jeanne for letting me know the rules. But does any body know the answer for the question I posted?

Thanks,
Lk.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

If you're only considering the Validation Framework (the framework where validations are defined in an xml file), you can use ValidatorActionForm and ValidatorForm.

If you're not using the Validator Framework you can still easily code your validations and extend any ActionForm class you want.


A good workman is known by his tools.
Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 120
Thanks Mark for the reply. But can you please let me know of how to disable the client side validation and enable the server side validation. Can you tell me what changes should I make in the code. This is the code I have:














Thank you very much for your time.

Lk.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

In the JSP -
Take out the html:javascript tag and take out the onsubmit attribute from the html:form tag.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Struts Validation