• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Validation

 
Luke Zechariah
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
author & internet detective
Marshal
Posts: 34851
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Luke Zechariah
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Luke Zechariah
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the JSP -
Take out the html:javascript tag and take out the onsubmit attribute from the html:form tag.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic