What options do I have to read the roles of the current user from my JSP pages? I'm aware of the visibleOnUserRole="myRole"
attribute on Tomahawk components, but I need roles for a bit more complicated things than simple visibility.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
In Java EE 6 (which wasn't available when this question was asked/answered), you can test roles directly from the
request
variable in your Facelets code. This is super-convenient.E.g.
The ExternalContext exposes user and role information.
If you're using JSF in servlets, this information maps to the values exposed by the HttpServletRequest.
You can use managed beans to expose values to the view via the Expression Language.