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

Java 在JSP中的两个不同列中显示单个列表值,java,jsp,Java,Jsp,如何根据ID在两个不同的列中显示列表值 <div id="mappedORg"> <table width="100%" id="myTable" class="sortable"> <tr> <h1>Mapped Organization</h1> <thead> <tr> <th><strong><s:property

如何根据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>
我想在不同的列中显示大学和学院,因为不同的大学有不同的学院,并且都来自同一个列表 乌斯罗格映射。我怎样才能显示所有大学与大学的关系。
如何在jsp页面中执行此操作?

您需要在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>


我使用过,但有一个条件,所有大学都有不同的学院,因为userOrgMappedList既有大学值也有学院值,我无法设置这样的条件(userOrgMappedList[#questat.index].org\u parent\u ID==userOrgMappedList[#questat.index].org\u ID),然后根据universiy为学院弹出下一列。如何在jsp页面中实现此条件大学和学院在mysql数据库的同一列中只有类型不同大学的ID为'1'大学的ID为'2'。您可以在查询本身中使用
group by
,以获取大学及其学院。您能指定我没有得到的查询如何使用group by子句吗在这里
<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>