• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2 tags not always working...

 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Rusty Enisin
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic