Quantcast

Struts2 - validation message displayed twice

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Struts2 - validation message displayed twice

daheri
For some reason validation error-messages are displayed twice in my appfuse2-struts application.
I am talking about the error messages displayed above the form.
 
After investigating and adding debug info to the messages.jsp, i found out that this one is displayed first:
<%-- FieldError Messages - usually set by validation rules –%>
 
Then just below it this one is displayed:
<%-- Error Messages (on JSPs, not through Struts –%>
 
So basicly, if my forms fail validation, the user will first be told twice about his error:
Example:
“Username is required”
“Username is required”
 
Then just above the field itself it will also be displayed that “Username is required”
 
Any ideas whats up with this?
 
Thanks in advance!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Struts2 - validation message displayed twice

Josep García
I found the same problem.
What I did was to comment-out the error messages on JSP, not through Struts. I don't know if this has any undesirable side-effect. Maybe it would be better to use and if-else logic?

Cheers,
Josep


2011/7/28 Erik Dahl <[hidden email]>
For some reason validation error-messages are displayed twice in my appfuse2-struts application.
I am talking about the error messages displayed above the form.
 
After investigating and adding debug info to the messages.jsp, i found out that this one is displayed first:
<%-- FieldError Messages - usually set by validation rules –%>
 
Then just below it this one is displayed:
<%-- Error Messages (on JSPs, not through Struts –%>
 
So basicly, if my forms fail validation, the user will first be told twice about his error:
Example:
“Username is required”
“Username is required”
 
Then just above the field itself it will also be displayed that “Username is required”
 
Any ideas whats up with this?
 
Thanks in advance!

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Struts2 - validation message displayed twice

mraible
Administrator
I remember seeing this issue and removed the duplication. Then I discovered that errors didn't show up in some cases, so I left them in there. If you guys figure out the best solution, please let me know and I'll adjust things for the next release.

On Mon, Aug 1, 2011 at 2:13 AM, Josep García <[hidden email]> wrote:
I found the same problem.
What I did was to comment-out the error messages on JSP, not through Struts. I don't know if this has any undesirable side-effect. Maybe it would be better to use and if-else logic?

Cheers,
Josep



2011/7/28 Erik Dahl <[hidden email]>
For some reason validation error-messages are displayed twice in my appfuse2-struts application.
I am talking about the error messages displayed above the form.
 
After investigating and adding debug info to the messages.jsp, i found out that this one is displayed first:
<%-- FieldError Messages - usually set by validation rules –%>
 
Then just below it this one is displayed:
<%-- Error Messages (on JSPs, not through Struts –%>
 
So basicly, if my forms fail validation, the user will first be told twice about his error:
Example:
“Username is required”
“Username is required”
 
Then just above the field itself it will also be displayed that “Username is required”
 
Any ideas whats up with this?
 
Thanks in advance!


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Struts2 - validation message displayed twice

tibi
i recognize this. often i comment the errors so that they are in the source code but do not clutter the screen.

tibi

On 09/08/2011 12:01 AM, Matt Raible wrote:
I remember seeing this issue and removed the duplication. Then I discovered that errors didn't show up in some cases, so I left them in there. If you guys figure out the best solution, please let me know and I'll adjust things for the next release.

On Mon, Aug 1, 2011 at 2:13 AM, Josep García <[hidden email]> wrote:
I found the same problem.
What I did was to comment-out the error messages on JSP, not through Struts. I don't know if this has any undesirable side-effect. Maybe it would be better to use and if-else logic?

Cheers,
Josep



2011/7/28 Erik Dahl <[hidden email]>
For some reason validation error-messages are displayed twice in my appfuse2-struts application.
I am talking about the error messages displayed above the form.
 
After investigating and adding debug info to the messages.jsp, i found out that this one is displayed first:
<%-- FieldError Messages - usually set by validation rules –%>
 
Then just below it this one is displayed:
<%-- Error Messages (on JSPs, not through Struts –%>
 
So basicly, if my forms fail validation, the user will first be told twice about his error:
Example:
“Username is required”
“Username is required”
 
Then just above the field itself it will also be displayed that “Username is required”
 
Any ideas whats up with this?
 
Thanks in advance!


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Struts2 - validation message displayed twice

Josep García
In reply to this post by mraible
The question would be: is it possible that both error sections need to be displayed? In which situation would both have different error messages? If none, an if-else block would solve the duplication.

Josep

2011/9/8 Matt Raible <[hidden email]>
I remember seeing this issue and removed the duplication. Then I discovered that errors didn't show up in some cases, so I left them in there. If you guys figure out the best solution, please let me know and I'll adjust things for the next release.


On Mon, Aug 1, 2011 at 2:13 AM, Josep García <[hidden email]> wrote:
I found the same problem.
What I did was to comment-out the error messages on JSP, not through Struts. I don't know if this has any undesirable side-effect. Maybe it would be better to use and if-else logic?

Cheers,
Josep



2011/7/28 Erik Dahl <[hidden email]>
For some reason validation error-messages are displayed twice in my appfuse2-struts application.
I am talking about the error messages displayed above the form.
 
After investigating and adding debug info to the messages.jsp, i found out that this one is displayed first:
<%-- FieldError Messages - usually set by validation rules –%>
 
Then just below it this one is displayed:
<%-- Error Messages (on JSPs, not through Struts –%>
 
So basicly, if my forms fail validation, the user will first be told twice about his error:
Example:
“Username is required”
“Username is required”
 
Then just above the field itself it will also be displayed that “Username is required”
 
Any ideas whats up with this?
 
Thanks in advance!



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Struts2 - validation message displayed twice

Josep García
In reply to this post by mraible
Seems to be an Struts upgrade effect. In AppFuse 2.0, messages.jsp is the same as in 2.1.0, and there are no duplications.

Josep


2011/9/8 Matt Raible <[hidden email]>
I remember seeing this issue and removed the duplication. Then I discovered that errors didn't show up in some cases, so I left them in there. If you guys figure out the best solution, please let me know and I'll adjust things for the next release.


On Mon, Aug 1, 2011 at 2:13 AM, Josep García <[hidden email]> wrote:
I found the same problem.
What I did was to comment-out the error messages on JSP, not through Struts. I don't know if this has any undesirable side-effect. Maybe it would be better to use and if-else logic?

Cheers,
Josep



2011/7/28 Erik Dahl <[hidden email]>
For some reason validation error-messages are displayed twice in my appfuse2-struts application.
I am talking about the error messages displayed above the form.
 
After investigating and adding debug info to the messages.jsp, i found out that this one is displayed first:
<%-- FieldError Messages - usually set by validation rules –%>
 
Then just below it this one is displayed:
<%-- Error Messages (on JSPs, not through Struts –%>
 
So basicly, if my forms fail validation, the user will first be told twice about his error:
Example:
“Username is required”
“Username is required”
 
Then just above the field itself it will also be displayed that “Username is required”
 
Any ideas whats up with this?
 
Thanks in advance!



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Struts2 - validation message displayed twice

itsme.incredible
This post has NOT been accepted by the mailing list yet.
In reply to this post by daheri
If you are using a table on ur jsp to display the form, then make sure that the table is a parent of the form tag. If the table is a child of form tag, the validation messages wont get cleared each time. Making the form tag as a child of table tag would solve your problem.
Loading...