struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Demetz <>
Subject Hibernate problem with OGNL
Date Tue, 26 Mar 2013 16:49:48 GMT

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=""/>.

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=""/>

Did anyone experience something simliar or has any suggestions?
OGNL 3.0.6, Hibernate 4.2, Struts 2.3.12


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message