Struts: messagespresent true when JSP is rendered from Action Servlet

C

Chris

Hey there.

I updated my validation to use Struts 1.1 validation features. The
problem I'm having is that my JSPs are rendered from Action Servlets
causing the messagespresent to be true when a form page is loaded.
Because messagespresent is true, the "Validation Errors" section is
being displayed. From what I read it appears that ActionMessages or
ActionErrors is present in the request triggering messagespresent to
be true. My Action Servlets extend LookupDispatchAction.

How can I prevent "Validation Errors" from being displayed when a form
is rendered for user input?

Thanks.
 
R

Rick Osborn

Not to sound elementary, but is this beyond the use of a <logic:isPresent> tag?
 
W

Wendy S

(e-mail address removed) (Chris) wrote
This is getting to be a very frequently asked question... search the
archives of the struts-user mailing list and find a few solutions. My
preferred solution is to override the 'validate' method in the Form bean
(even if it's a dynamic form) and only call super.validate() when
appropriate.

The framework makes no distinction between the first and subsequent displays
of the form, it's always going to call validate, so you have to put in some
logic to decide whether validation is appropriate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top