• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error Message rendering twice in struts2 because of integration with spring

 
Jyothi Sree
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have a Struts2 application ,In the jsp page i have struts-tags: textfeilds which are required and a submit button ,In which i have a "email" feild for which i used spring mail bean and could send the mail properly .

When i hit the button with out entering the feilds then i get the validation errors ,till here its fine ,

The problem is when i press the submit button with out entering the values (for the 2nd time ) i get the error message one more time ( ie 2 times it is rendering )
If i press 3rd time i get the error messages 3 times ,If i remove the Spring beans its working fine ...


How should i solve this ?

Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make the action beans "prototype" scope instead of singletons.
 
Jyothi Sree
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have made my bean scope as singleton .Even then multiple error messages are displayed on multiple submittion of the button .
 
Raza Mohd
Ranch Hand
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,

Kindly concentrate on David's words what he is actually trying to say..Make scope as "Prototype".

Thanks,
Raza
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:Make the action beans "prototype" scope instead of singletons.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic