开发者

EL expression can access the son of son object in scope?

开发者 https://www.devze.com 2023-03-06 18:21 出处:网络
Can I use EL expres开发者_StackOverflow社区sion like this ? Topic comes from a requestScope param that is List.

Can I use EL expres开发者_StackOverflow社区sion like this ? Topic comes from a requestScope param that is List.

${topic.person.username}

Taking that Topic has a Person and Person has username. I am getting an error telling me that

Property 'username' not found on type br.com.gsc.model.tableMapping.User


It should work fine. The error is just telling that ${topic.person} returns an instance of the br.com.gsc.model.tableMapping.User class which in turn doesn't have a public String getUsername() method. One of those two facts is probably not what you expect. Fix the code accordingly. Perhaps it has to be a different type or the method is indeed missing/incorrect?

0

精彩评论

暂无评论...
验证码 换一张
取 消