This is one of the craziest things I have seen. I am building a Struts2/Spring/JPA/MySQL app. I am using the struts2 tags to iterate over and print out values of beans in collections. The beans are JPA Entity beans. The entities have ralationships mapped.
Everything appears to work fine. I load the page and it is populated correctly. I refresh the page and everything goes away. I put in some logging to see what was pulled from the database. Everything was there in the logs. The entities made it to the action class. But the tags in the JSP are rendering nothing. If I restart the app it works one more time again.
I have another page that I can refresh several times without a problem.
The squeaky wheel gets the grease. Well, that or replaced...
Joined: May 26, 2005
I guess it would seem appropriate to mention I am using Struts 2 version 2.0.6. After sleeping on this I realized this has to be a struts bug. I tried using JSTL tags to iterate over the collections, but that failed too. That means somehow the beans make it to the action but then the action is never available to the JSP
So I upgraded Struts2 to 2.0.9. Bingo. I can refresh the pages all I wish and they are always populated.