在JSP中的2个不同列中显示单个列表值

时间:2016-10-03 06:01:30

标签: java jsp

如何根据ID'在两个不同的列中显示列表值?

<div id="mappedORg">
  <table width="100%" id="myTable" class="sortable">
    <tr>
      <h1>Mapped Organization</h1>
    <thead>
      <tr>
        <th><strong><s:property value="getText('global.univeristy')" /></strong></th>
        <th ><strong><s:property value="getText('global.college')" /></strong></th>
      </tr>
    </thead>
    <tbody>
      <s:iterator value="userOrgMappedList" var="quesvar" status="questat">
      <tr>
        <td valign="top" class="style11" style="width: 20%;"><s:property  value="userOrgMappedList[#questat.index].OrgName"/></td>
      </s:iterator>
      </tr>

这是我获取大学和大学的查询

SELECT UOM.Organization_ID, OM.Organization_Name, OM.Organization_Type_ID, UOM.Is_Active,OM.Organization_Parent_Id FROM T_User_Organization_Map UOM  
INNER JOIN M_Organization_Master OM ON UOM.Organization_ID = OM.Organization_ID 
INNER JOIN M_Organization_Type_Master OTM ON OM.Organization_Type_ID=OTM.Organization_Type_ID
LEFT OUTER JOIN M_Organization_Master LOM ON OM.Organization_Parent_Id = LOM.Organization_ID WHERE UOM.User_ID IN (' 1 ')  AND OM.Is_Active = 1 ORDER BY OM.Organization_Name


Query is returing organization_parent_id as whose organization_id is university for that particular organization.

我想在不同的专栏中显示大学和学院,因为不同的大学有不同的大学,所有都是从同一个名单中取出 usrOrgMapping。如何在大学方面展示所有学院。 如何在jsp页面中执行此操作?

1 个答案:

答案 0 :(得分:0)

你需要在TR

内的循环中使用两个不同的TD
<s:iterator value="userOrgMappedList" var="quesvar" status="questat">
<tr>
<td valign="top" class="style11" style="width: 20%;"><s:property  value="userOrgMappedList[#questat.index].univeristy"/></td>
<td valign="top" class="style11" style="width: 20%;"><s:property  value="userOrgMappedList[#questat.index].OrgName"/></td>
</tr>
</s:iterator>