Win a copy of JDBC Workbook this week in the JDBC and Relational Databases forum
or A Day in Code in the A Day in Code 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

ActionForm validate

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating easy CRUD application.
I am trying to use method validate in class extended ActionForm. But I am doing it wrong probably.




IF the line is uncommented:

1. If I remove the comment(above) in the validate method it will not call methods in class extended DispatchAction.
(These methods are call with commeted line and it work fine.)

2. Next issue: It will entry to the condition, if it entry to the form.
(getName() is null).

Could you help me, please.
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey manu,
I couldnt follow you completly. Why are you throwing that errror? Is it like name is required? and also if the user does not enter anything in the field the "getName()" will give you an empty string and not a null(as far as i know). So i think something like this may work:


So this will give an error everytime the user enters nothing,
 
I promise I will be the best, most loyal friend ever! All for this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic