• 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

struts validate() question

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have been debugging my first struts app. It uses a LookupDispatch Action to perform CRUD methods. When the detail page is displayed, the user has the option to Edit or Delete the information. If I clear out one of the required fields, and hit Edit, it seems that validation is skipped because I get a db exception where a null value was attempted to be put in a required db column. After further investigation, I was messing around with the Add portion. I notice that if I enter some of the required data, hit enter, the validate() method is called, and, as expected, the errors for the remaining required fields are displayed. Next, I enter more (but still not all) of the required data, and hit enter. Now, I have a similar db exception as was described above on the Edit page.

I don't understand why it seems that the validate() method is not called before every submit. Does anyone have any ideas on this matter?

Just to clarify, I am not using the validator plugin, just the validate() method in the action form bean.

Toni
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you paste the code of struts-config.xml, action, actionform and jsp?

Thank you,

Lk.
 
Toni Heightland
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
problem solved. thanks for your interest.
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would be nice if could explani how you fixed the problem. Just to know.
reply
    Bookmark Topic Watch Topic
  • New Topic