• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

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,
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!