Announcement Announcement Module
Collapse
No announcement yet.
View only the logged user info in the jspx... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • View only the logged user info in the jspx...

    I want to list only my user "admin" info, not all the info of all users.
    This is my list.jspx

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <div
    xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlnsage="urn:jsptagdir:/WEB-INF/tags/form"
    xmlns:table="urn:jsptagdir:/WEB-INF/tags/form/fields"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:spring="http://www.springframework.org/tags"
    xmlns:security="http://www.springframework.org/security/tags"
    version="2.0">

    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <jsp:output omit-xml-declaration="yes"/>

    <h1>Example</h1>
    username: <security:authentication property="principal.username" /><br/>
    password: <security:authentication property="principal.password" /><br/>

    <br/>
    principal.id: ${principal.id}<br/>
    principal.username: ${principal.username}<br/>
    cuentases[0].nombre: ${cuentases[0].nombre}<br/>
    <br/>

    <page:list id="pl_com_andalux_model_Cuentas" items="${cuentases}">
    <table:table data="${cuentases}" id="l_com_andalux_model_Cuentas" path="/cuentases">
    <table:column id="c_com_andalux_model_Cuentas_nombre" property="nombre"/>
    <table:column id="c_com_andalux_model_Cuentas_descripcion" property="descripcion"/>
    <table:column date="true" dateTimePattern="${cuentas_fecha_creacion_date_for mat}"
    id="c_com_andalux_model_Cuentas_fecha_creacion" property="fecha_creacion"/>
    <table:column id="c_com_andalux_model_Cuentas_usuarios" property="usuarios"/>
    </table:table>
    </page:list>

    </div>

  • #2
    With this I can see only the user's accounts:

    <c:forEach var="accounts" items="${accountses}" >
    <c:if test="${accounts.users.username == var_username}">
    <c:out value="${accounts.id}"/><br/>
    <c:out value="${accounts.users.username}"/><br/>
    <c:out value="${accounts.name}"/><br/>
    </c:if>
    </c:forEach>

    Comment


    • #3
      You can see one solution here:
      http://forum.springsource.org/showth...he-logged-user

      Comment

      Working...
      X