?? userlist.jsp
字號:
<%@ include file="/jsp/common/environment.jsp" %>
<!-- tiles模版,以一個table開始-->
<table border="0" width="100%">
<tr>
<td>
<!-- 檢驗是否存在userlist對象,這個對象名跟相對應的action里面的httpServletRequest.setAttribute("userlist",userInfoList);相對應-->
<logic:notPresent name="userlist" >
<p align="center" class="help"><bean:message key="usermgr.list.empty"/></p>
</logic:notPresent>
<logic:present name="userlist" >
<table class="body2" cellspacing="1" align="center">
<!-- 顯示標題欄-->
<tr>
<td class="centerunbold1" width="5%"><bean:message key="userinfo.Id"/></td>
<td class="centerunbold1" width="17%"><bean:message key="userinfo.userLoginId"/></td>
<td class="centerunbold1" width="17%"><bean:message key="userinfo.name"/></td>
<td class="centerunbold1" width="6%"><bean:message key="userinfo.gender"/></td>
<td class="centerunbold1" width="30%"><bean:message key="userinfo.email"/></td>
<td class="centerunbold1" width="15%"><bean:message key="userinfo.officePhone"/></td>
<td class="centerunbold1" width="10%"><bean:message key="userlist.operation"/></td>
</tr>
<%
int i=0;
%>
<!-- 循環顯示用戶列表-->
<logic:iterate name="userlist" id="userinfo"
type="org.ithinking.strutsExample.entity.Userinfo">
<tr>
<td class="td2"><%=i++%></td>
<td class="td2"><bean:write name="userinfo" property="userloginid"/></td>
<td class="td2"><bean:write name="userinfo" property="username"/></td>
<td class="td2">
<logic:equal name="userinfo" property="sex" value="F">
<bean:message key="userinfo.female"/>
</logic:equal>
<logic:equal name="userinfo" property="sex" value="M"><bean:message
key="userinfo.male"/>
</logic:equal>
</td>
<td class="td2"><bean:write name="userinfo" property="email"/></td>
<td class="td2"><bean:write name="userinfo" property="phone"/></td>
<td class="td2">
<%
Userinfo userInfo1=(Userinfo)pageContext.getAttribute("userinfo");
Integer id=userInfo1.getId();
%>
<!-- 修改用戶信息的鏈接-->
<customtag:Authentication userId="<%=id%>" action="modify">
<a href="/StrutsExample/ShowUserAction.do?method=modify&id=<bean:write name="userinfo" property="id"/>">
<IMG height=18 alt=<bean:message key="global.edit"/> src="<%=imagesurl%>edit2.gif" width=17 align=middle border=0>
</a>
</customtag:Authentication>
<!-- 刪除用戶信息的連接-->
<customtag:Authentication action="delete">
<a href="/StrutsExample/DeleteUserAction.do?id=<bean:write name="userinfo"
property="id"/>" onclick="operateConfirm('<bean:message key="global.comfirmdel"/>')"><IMG
height=18 alt=<bean:message key="global.delete"/> src="<%=imagesurl%>delete.gif" width=17
align=center border=0></a>
</customtag:Authentication>
</td>
</tr>
</logic:iterate>
</table>
</logic:present>
</td>
</tr>
</table>
<table border="0" width="100%">
<tr>
<td>
<!-- 顯示出錯信息-->
<div align=center>
<logic:messagesPresent>
<bean:message key="errors.header"/>
<ul>
<html:messages id="error">
<bean:message key="errors.prefix"/><bean:write name="error"/><bean:message key="errors.suffix"/><br>
</html:messages>
</ul><hr />
</logic:messagesPresent>
</div>
</td>
</tr>
</table>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -