This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Struts2 POJO population from URL

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a Java Object with many other nested Objects and lists of Objects. When the request arrives from the client, I see that the Object is populated only to a few levels. Is there any configuration that sets this is Struts 2? Here is my example.



When I call the `populate` method and when send to the jsp, the iteration happens good with all the elements. But, when I try to update, i.e. when then form is submitted, the `update()` method is called, but the instance variable abc does not get populated completely.

I have seen the url which is passed and everything seems to be fine. Let me tell you what happens. The url will be something like (splitting with line break for easy understanding here),



In this case, the `defList` inside `abc` and `ghi.ghiName` in `abc` are populated with no issues. But the `defList` of `abc.ghi` is not populated. Is this a common behavior of Struts 2? Is there any means by which this can be overridden?
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use preperable interface and override prepare method in your action class. And add it to interceptors. This interceptor is very useful for any situation where you need to ensure some logic runs before the actual execute method runs.
 
All of life is a contant education - Eleanor Roosevelt. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic