Announcement Announcement Module
Collapse
No announcement yet.
roo security show user details Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • roo security show user details

    I know this is a dumb question, but I can't seem to figure out how to display the current logged in user in my roo generated application. Roles and authentication are working fine, just can't display any current user info.

    Can someone please show me how to do this?

    Many thanks!

  • #2
    I figured it out by looking at the src/main/webapp/WEB-INF/layouts/default.jspx page.

    All I had to do was use: ${pageContext.request.userPrincipal.name}. See below for an example of how I am using it.

    <c:if test="${pageContext.request.userPrincipal != null}">
    <c:out value="&#160;|&#160;"/>
    <span>
    <spring:url var="logout" value="/static/j_spring_security_logout" />
    <a href="${logout}"><spring:message code="security.logout" /></a>
    Logged in as: ${pageContext.request.userPrincipal.name}
    </span>
    </c:if>

    Comment


    • #3
      Spring Security offers a taglib that can be used for this purpose: http://static.springsource.org/sprin...cationTag.html

      Comment


      • #4
        Thanks. Ben.

        I tried to use the authz tag library but am still not able to get a working example. I am new to Spring Security so am learning as I go.

        Comment


        • #5
          Without detailed information we will probably not be able to help you that much, but I am sure if you search the Spring Security forum or ask detailed questions there you can get this resolved quickly.

          Cheers,
          Stefan

          Comment

          Working...
          X