Robert
Robert

Reputation: 1638

What's the correct way to get to the username using EL?

I have a static method that returns a list of a type. In order for me to get a username from type I have to do the following type.getUser.getUserName. What's the correct way to get to the username using EL? I tried type.user.userName, but that didn't work.

Upvotes: 0

Views: 96

Answers (2)

Kees de Kooter
Kees de Kooter

Reputation: 7195

The correct EL syntact would be type.user.userName. That is without the getters.

Upvotes: 0

Bozho
Bozho

Reputation: 597106

${type.user.userName} is the proper way to go. If it "doesn't work" (how exactly it doesn't?), it may be because the user is null.

Upvotes: 1

Related Questions