• 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

ActionErrors problem

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using the validate method on ActionForm, and the validate execute every time that I request the URL contacts.do, the problem is that the error message appear in the first time that I request the URL. The message should not appear in the first time, but just when the client push the OK button... how can I cancel the error message if is the first request?
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using ValidatorActionForm? If not all you have to do is return empty ActionMessages in the validate method:



If you are using ValidatorActionForm, override validate and inside code:

[CODE]
if( "GET".equalsIgnoreCase( request.getMethod() ) )
return null;
else
return super.validate();

Unless the ok button is a get request. In that case check for the name and value of the button.
[ September 02, 2005: Message edited by: Kerry Wilson ]
reply
    Bookmark Topic Watch Topic
  • New Topic