• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Confused on validate() method

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic