Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Confused on validate() method

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I am using DynaValidatorForm in my struts-config.xml, then why do I still need a Class with a validate() method? I thought that using the dynamic validation on standard validation like, required, mask, etc you didn't need to write the validation code anywhere?
It is kind of like, we used DynaForm to lose the Bean class that just sets and gets variables, which is good, but then we just add another class that is to handle the validation even though we have dynavalidatorform classes?
I am just really confused on this. Why is this so hard for me? STRUTS is making me lose sleep, but everyone thinks it is the best thing in the world? I want to learn how to use it, and I even have 2 books. Of couse both books give "code snippets" which I hate because they never tell you what class they belong to. ARRRGGGG Sorry, just venting a little.
Can someone give me a good clear answer to my question(s)? And please don't tell me to go look at the Newsletter. I have looked at it, the examples, and I have made them work. But it is not making me understand WHY.
Thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I got some validation to work on my form. The problem is now I am getting the stupid little alert() box telling me what validated wrong. That is worse than all the Messages at the top of the page.
I really need this explained to me or something. I will see if I can post some of this code. Right now, I am only validating the one TitleField.
AddReferenceAction

AddReferenceBean - This has the validate() method

My FORM Tag in my validation.xml file

My FORM-BEAN in my struts-config.xml

AddReference.jsp

application.properties file

[ August 05, 2003: Message edited by: Gregg Bolinger ]
[ August 05, 2003: Message edited by: Gregg Bolinger ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I finally found a decent tutorial that took a little bit different approach and really utalized 1.1's validation. So I lost the AddReferenceBean class and below is my AddReferenceAction class revised:
 
I was her plaything! And so was this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic