This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes Error Message rendering twice in struts2 because of integration with spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Error Message rendering twice in struts2 because of integration with spring " Watch "Error Message rendering twice in struts2 because of integration with spring " New topic
Author

Error Message rendering twice in struts2 because of integration with spring

Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41

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

Joined: Sep 29, 2008
Posts: 12617

Make the action beans "prototype" scope instead of singletons.
Jyothi Sree
Ranch Hand

Joined: Jun 14, 2010
Posts: 41
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

Joined: Jan 20, 2010
Posts: 247

hi ,

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

Thanks,
Raza


Good luck!!
A small leak can sink a Gigantic ship.>
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

David Newton wrote:Make the action beans "prototype" scope instead of singletons.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error Message rendering twice in struts2 because of integration with spring