notelist.jsp

来自「java jsp教程」· JSP 代码 · 共 207 行

JSP
207
字号
<!--\webapps\jsp\notelist.jsp by zhangl-->

<%@ page  contentType="text/html;charset=GBK" %>
<%@ page import=" java.util.* "%>
<%@ page import="com.icss.cnpc.msgnote.vo.NoteInfo1VO "%>
<%@ page import="com.icss.cnpc.msgnote.vo.Note2VO"%>
<%@ page import="com.icss.cnpc.msgnote.util.DateUtility" %>
<%@ page import="com.icss.cnpc.msgnote.util.CommonUtil" %>
<%@ page import="com.icss.cnpc.msgnote.util.StringUtility" %>
<%@ page import="com.icss.j2ee.util.PageScrollUtil" %>

<%
    response.setHeader("Pragma", "No-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 0);
%>

<%
   // int PageNum = PageScrollUtil.getPageNum();
    String contextpath = request.getContextPath();

    List notelist = (List)request.getAttribute("notelist");
	String cursendUnit = StringUtility.filterNullObject((String)request.getAttribute("cursendUnit"));
	String curnoteTitle = StringUtility.filterNullObject((String)request.getAttribute("curnoteTitle"));
	String cursendPerson = StringUtility.filterNullObject((String)request.getAttribute("cursendPerson"));
	String curimpdegree = StringUtility.filterNullObject((String)request.getAttribute("curimpdegree"));
    
	int currentPageNum = PageScrollUtil.getPageNum();
	String curDate = StringUtility.filterNullObject(DateUtility.getCurrentDate());
%>


<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=GBK">
<link rel="stylesheet" href="<%=contextpath%>/css/style.css" type="text/css">
<script language="JavaScript" src="<%=contextpath%>/include/common.js"></script>
<script language=JavaScript>
  function query()
  {
    window.location.href = "<%=contextpath%>/servlet/NoteInfoListServlet?noteTitle="+NotesList.noteTitle.value+"&sendUnit="+NotesList.sendUnit.value+"&sendPerson="+NotesList.sendPerson.value+"&impdegree="+NotesList.impdegree.value;
  }
  
  function ViewNotes(flag,CurID)
 {
  NotesList.operate.value=flag;
  NotesList.ID.value=CurID;
  window.location.href = "<%=contextpath%>/servlet/NoteOperServlet?ID="+NotesList.ID.value+"&operate="+NotesList.operate.value;
 }
 
    function clearAll()
  {
    NotesList.noteTitle.value = "";
	NotesList.sendUnit.value = "";
	NotesList.sendPerson.value = "";
	NotesList.impdegree.options[0].selected = true;
  }

   function viewreader(flag,CurID)
 {
 	NotesList.operate.value=flag;
    NotesList.ID.value=CurID;
	window.open("<%=contextpath%>/servlet/NoteManageOperServlet?ID="+NotesList.ID.value+"&operate="+NotesList.operate.value,'基本信息','width=800,height=600,SCROLLBARS=1');
 }
</script>

</head>
<body bgcolor="#FFFFFF" text="#000000" background="<%=request.getContextPath()%>/images/grid.gif"  leftmargin="0" topmargin="0">

<form  Name="NotesList" method="Post" action="">
<input name="ID" type="hidden" value="">
<input name="operate" type="hidden" value="">
          <table width="95%" border="0" align="center" cellpadding="0" cellspacing="1"  bordercolordark="#DFDFFF" bordercolorlight="#003366" bgcolor="#6699CC">
			<tr bgcolor="#EEF4FF">
		     <td height="24" colspan="5" align="center"  bgcolor="#a6d0f2">公告简单查询</td>
		    </tr>
			<tr bgcolor="#EEF4FF">
				<td align="center">&nbsp;
			    公告标题</td>
				<td align="left"><input type=text name="noteTitle" value="<%=curnoteTitle%>" maxlength="20"></td>
				<td align="center">
				<%if(CommonUtil.Is1tN().equals("1")){%>
					发送单位
				  <%}else{%>
				 发送部门
				  <%}%>
				</td>
			  <td align="left"><input type = text name = "sendUnit" value="<%=cursendUnit%>" maxlength="20"></td>
				<td rowspan="2">
				<div align="center">
				  <img src="<%=contextpath%>/images/search.gif" style="CURSOR: hand" onClick='javascript:query()'>
				  <img src="<%=contextpath%>/images/reset.gif" style="CURSOR: hand" onClick='javascript:clearAll()'>
				</div>
				</td>
				  
			</tr>
			<tr bgcolor="#EEF4FF">
				<td align="center">&nbsp;
			    发送人</td>
				<td align="left"><input type = text name="sendPerson" value="<%=cursendPerson%>" maxlength="20"></td>
				<td align="center">重要程度</td>
			    <td align="left">		     <select name="impdegree">
			      <option value="" <%if(curimpdegree.equals("")){%>selected<%}%>>全部</option>
			      <option value="0" <%if(curimpdegree.equals("0")){%>selected<%}%>>一般</option>
			      <option value="1" <%if(curimpdegree.equals("1")){%>selected<%}%>>紧急</option>
			    </select> </td>
			</tr>
		</table>
		<br>
                <table width="95%" align="center" cellpadding="0" cellspacing="1"  bordercolordark="#DFDFFF" bordercolorlight="#003366" bgcolor="#6699CC">
                <tr bgcolor="#EEF4FF">
				  <td height="24" align="center"  bgcolor="#a6d0f2" <%if(CommonUtil.Is1tN().equals("1")){%>colspan="10"<%}else{%>colspan="9"<%}%>>公告列表</td>
				</tr>
				<tr bgcolor="#a6d0f2" height="24"> 
                  <td width="4%" align="center">序号</td>
                  <td width="23%" align="center">标题</td>
                  <td width="9%" align="center">发送人</td>
                  <td width="14%" align="center">
				  <%if(CommonUtil.Is1tN().equals("1")){%>
					  发送单位
				  <%}else{%>
				     发送部门
				  <%}%>
				  </td>
                  <td width="13%" align="center" class=td1>发送时间</td>
                  <td width="6%" align="center" class=td1>重要程度</td>
				  <%if(CommonUtil.Is1tN().equals("1")){%>
				  <td width="8%" align="center" class=td1>发布范围</td>
				  <%}%>
                  <td width="4%" align="center" class=td1>附件数量</td>
				  <td width="8%" align="center" class=td1>有效期</td>
				  <td width="6%" align="center" class=td1>当前状态</td>
                </tr>
                <% 
				  int num = 10*(currentPageNum-1);
                  for(Iterator i = notelist.iterator();i.hasNext();){
                      NoteInfo1VO vo = (NoteInfo1VO)i.next();
                      String noteId = StringUtility.filterNullObject(vo.getNoteId());
                      String noteTitle = StringUtility.filterNullObject(vo.getNoteTitle());
                      String sendUnitId = StringUtility.filterNullObject(vo.getSendUnitId());
                      String sendUnit = StringUtility.filterNullObject(vo.getSendUnit());
                      String sendPersonid = StringUtility.filterNullObject(vo.getSendPersonid());
                      String sendPerson=StringUtility.filterNullObject(vo.getSendPerson());
					  String sendOrgName=StringUtility.filterNullObject(vo.getSendOrgName());
					  String sendOrgId=StringUtility.filterNullObject(vo.getSendOrgId());
					  String status = StringUtility.filterNullObject(vo.getStatus());
					  String validDate=StringUtility.filterNullObject(vo.getValidDate());
					  String sendTime=StringUtility.filterNullObject(vo.getSendTime()).toString().substring(0,16);
					  String attacthNum=StringUtility.filterNullObject(vo.getAttatchNum());
					  String impdegree=StringUtility.filterNullObject(vo.getImpdegree());
					  String ext1 = StringUtility.filterNullObject(vo.getExt1());
					  num++;
                %>
                <tr bgcolor="#EEF4FF" height="24"> 
                  <td align="center"><%=num%></td>
                  <td align="left"><a href="javascript:ViewNotes('view','<%=noteId%>')"><font color="#0000CC"><%=noteTitle%></font></td>
                  <td align="center"><%=sendPerson%></td>
                  <td align="center">
				  <%if(CommonUtil.Is1tN().equals("1")){%>
					  <%=sendUnit%>
				  <%}else{%>
				     <%=sendOrgName%>
				  <%}%>
				  </td>
                  <td align="center"><%=sendTime%></td>
   				  <td align="center">
				    <%if(impdegree.equals("0")){%>一般<%}else{%><font color="#FF0000">紧急!</font>
				    <%}%>
		          </td>
				  <%if(CommonUtil.Is1tN().equals("1")){%>
				  <td align="center">
				    <%if(ext1 != null){%>
				    <%=sendOrgName%>
					<%}%>
				  </td>
				  <%}%>
   				  <td align="center">
				    <%if(!attacthNum.equals("0"))%><%=attacthNum%>
				  </td>
				  <td align="center"><%=validDate%></td>
				  <td align="center">
				    <%if(status.equals("0")){%>草稿<%}%>
					<%if(status.equals("1")){
					if(!validDate.equals("")){
					 if(DateUtility.compareDate(validDate,curDate)>=0){
					%>
					正式
					<%}else{%>
					过期
					<%}}else{%>正式<%}}%>
				  </td>
			   <% ;} %>
                </tr>
				<tr bgcolor="#EEF4FF" class="lc2" onmouseover="this.bgColor='#EBEBEB';" onmouseout="this.bgColor='#EEF4FF';"> 
                 <td align="center" height="23" <%if(CommonUtil.Is1tN().equals("1")){%>colspan="10"<%}else{%>colspan="9"<%}%>>
                  <%@ include file="../../include/defaultPageScrollBar.jsp" %>
                 </td>
                </tr>
				

          </table>
  <p> </p>
</form>

</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?