jQuery in Action, 3rd edition
The moose likes Struts and the fly likes Struts 2 tags not always working... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 tags not always working..." Watch "Struts 2 tags not always working..." New topic

Struts 2 tags not always working...

Rusty Enisin
Ranch Hand

Joined: May 26, 2005
Posts: 107
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.

Any ideas?

The squeaky wheel gets the grease. Well, that or replaced...
Rusty Enisin
Ranch Hand

Joined: May 26, 2005
Posts: 107
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.
I agree. Here's the link: http://aspose.com/file-tools
subject: Struts 2 tags not always working...
It's not a secret anymore!