我在做一个例子,用到了display标签
需求是这样的:<display:table name="personList" cellspacing="0" cellpadding="0" requestURI="" 
    defaultsort="1" id="allPersons" pagesize="20" class="list userList" export="true" style="width:98%" > <display:column property="id" escapeXml="true" sortable="true" titleKey="person.id" style="width: 8%"/>
    <display:column property="name" escapeXml="true" sortable="true" titleKey="person.name" style="width: 17%" 
    url="/editPerson.jspa?from=list" paramId="id" paramProperty="id"/>    
    <display:column property="age" escapeXml="true" sortable="true" titleKey="person.age" style="width: 10%"/>
 
   <display:column property="sex" escapeXml="true" sortable="true" titleKey="person.sex" style="width: 23%"/>
  
   
  
    <display:column property="scientific.name" escapeXml="true" sortable="true" titleKey="person.scientific" style="width: 23%"/>
    </display:table>目前我是这样写的,但是我保存的sex属性的内容是 0和1 ,我希望展现的时候sex为0则展现为男,1为女。
不知道怎么样在column里进行区分展现。我试着用 jstl的<c:choose > <c:when>标签来区分可老是报错,不知道是我
写的不对还是display不支持里面嵌套。

解决方案 »

  1.   

    是可以的,但看你这个<c:choose > <c:when>是写在哪里了
    <display:column escapeXml="true" sortable="true" style="width: 23%">
    要写在这里
    </display:column>
    property="sex"这个就不能加到display:column里了
      

  2.   

                    <c:choose>
       <c:when test="${sex == 0}">nan</c:when>
       <c:otherwise>nv</c:otherwise>
       </c:choose>
    我这样写的el表达式,可是sex不是page,request,session,context中的值取不到,我原来以为他会放到page中,可是这样却取不到,不知道该怎么判断