关于标签的使用

servlet部分:
class SessionContainer{
   ArrayList<User> users;
   public void setUsers (users){
        this.users=users
   }
}

sessionContainer.set(list);
Session.setAttribute("Container",sessionContainer)
//遍历bean中的集合对象
//jsp页面中获取值
<logic:iterate id="user" name="Container" property="users">
<bean:write name="user" property="userid"/>
<bean:write name="user" property="username"/>
<bean:write name="user" property="password"/>
</logic:iterate>



公司模块中用到的:
<logic:iterate id="masterCltslList" name="masterCltslForm_gt"
property="masterCltslList" indexId="idx">
<tr>
<!-- コード -->
<td class="list_data_bg"><input type="text"
name="masterCltslForm.gjyt_tanto_cd"
class="output default output_txt_height" size="
5"
value="<bean:write name="masterCltslList"
property="gjyt_tanto_cd"/>"
maxlength="5" style="ime-mode:active;" readonly /></td>
<!-- 営業担当者名 -->
<td class="list_data_bg"><input type="text"
name="masterCltslForm.gjyt_tanto" class="default" size="25"
value="<bean:write name="masterCltslList" property="gjyt_tanto"/>"
maxlength="10" style="ime-mode:active;" /></td>
<!-- 電話番号 -->
<td class="list_data_bg"><input type="text"
name="masterCltslForm.gjyt_tanto_tel" class="default"
size="19"
value="<bean:write name="masterCltslList" property="gjyt_tanto_tel"/>"
maxlength="15" style="ime-mode:disabled;" /></td>

<!-- FAX -->
<td class="list_data_bg"><input type="text"
name="masterCltslForm.gjyt_tanto_fax" class="default"
size="15"
value="<bean:write name="masterCltslList" property="gjyt_tanto_fax"/>"
maxlength="15" style="ime-mode:disabled;" /></td>

<!-- メールアドレス -->
<td class="list_data_bg"><input type="text"
name="masterCltslForm.gjyt_tanto_mail" class="default"
size="25"
value="<bean:write name="masterCltslList" property="gjyt_tanto_mail"/>"
maxlength="50" style="ime-mode:disabled;" /></td>

<!-- 最終更新者 -->
<td class="list_data_bg"><input type="text"
name="masterCltslForm.kosn_user_name"
class="output default output_txt_height" size="15"
value="<bean:write name="masterCltslList" property="kosn_user_name"/>"
maxlength="15" style="ime-mode:active;" readonly /></td>

<!-- 削除 -->
<td class="list_data_bg"><input class="checkbox_bj"
type="checkbox" id="masterDelFlag" value="1"></td>

</tr>
</logic:iterate>

你可能感兴趣的:(bean,jsp,servlet)