Hi,
I don't know if this is the right place to ask, but maybe there is
anyone who has experienced the same problem.
I'm using Struts2 (latest version), with Hibernate (latest version)
My database models all have getId().
I have situations, where the getId() method of my model class returns
null when navigating through OGNL e.g. when
calling <s:property value="#user.gallery.id"/>.
When I call getId() from the method in my action class (e.g.
UserListAction iterating though users and calling
user.getGallery().getId()), it returns the id as expected.
If I do that first in my action class, then also my <s:property.../>
renders the id as expected; so I thought about a lazy loading issue...
all my getId() methods are public, NOT final, and the Long id members
are protected.
I also tried to add a getMyId() method in the model which calls getId()
from within the same class.
getMyId() { return getId(); }
This surprisingly works and outputs the correct id when calling
<s:property value="#user.gallery.myId"/>
Did anyone experience something simliar or has any suggestions?
OGNL 3.0.6, Hibernate 4.2, Struts 2.3.12
Thanks,
Markus
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org