⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showdate.jsp

📁 精通tomcat书籍原代码,希望大家共同学习
💻 JSP
字号:
<%
/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/dlog4j.tld" prefix="dlog" %>
<%@ page import="java.util.*,dlog4j.LogManager,dlog4j.UserManager,dlog4j.formbean.LogForm" %>

<dlog:getsite id="site"/>

<bean:parameter id="year" name="log_year" value="-1"/>
<bean:parameter id="month" name="log_month" value="-1"/>
<bean:parameter id="date" name="log_date" value="-1"/>

<h3><bean:message key="SHOWDATE_TITLE" bundle="html" arg0="<%=site.getDisplayName()%>" arg1="<%=(year+'-'+month+'-'+date)%>"/></h3>

<table border='0' width='100%' cellpadding='0' cellspacing='0'>
  <% int i=1; %>
  <dlog:logs id="logs"/>
  <bean:size id="logCount" name="logs"/>
  <tr><td colspan=3><b><bean:message key="SHOWDATE_LOG_TITLE" bundle="html" arg0="<%=String.valueOf(logCount)%>"/></b></td></tr>
  <tr><td colspan=3>&nbsp;</td></tr>
  <logic:iterate id="log" name="logs">
  <tr <%if(i%2==0){%>bgcolor='#eeeeee'<%}%>>
  	<td valign='top'><%=(i++)%>.</td>
    <td><html:link page="/showlog.jspe" paramId="log_id" paramName="log" paramProperty="id"><bean:write name="log" property="title" filter="false"/></html:link> [<html:link page="/main.jspe" paramId="cat_id" paramName="log" paramProperty="category.id"><bean:write name="log" property="category.name"/></html:link>]</td>
    <td align='right'><bean:message key="LOG_STAT" bundle="html" arg0="<%=String.valueOf(((LogForm)log).getReplyCount())%>" arg1="<%=String.valueOf(((LogForm)log).getViewCount())%>"/></td>
  </tr>
  </logic:iterate>
</table><br>
<%
	int iYear = Integer.parseInt(year);
	int iMonth = Integer.parseInt(month);
	int iDate = Integer.parseInt(date);
	List replies = LogManager.listRepliesByDate(site, iYear,iMonth,iDate);
	pageContext.setAttribute("replies", replies);
	i = 1;
%>

<table border='0' width='100%' cellpadding='0' cellspacing='0'>
  <tr><td colspan=3><b><bean:message key="SHOWDATE_COMMENT_TITLE" bundle="html" arg0="<%=String.valueOf(replies.size())%>"/></b></td></tr>
  <tr><td colspan=3>&nbsp;</td></tr>
  <logic:iterate id="reply" name="replies">
  <tr <%if(i%2==0){%>bgcolor='#eeeeee'<%}%>>
  	<td valign='top'>&nbsp;<%=(i++)%>.&nbsp;</td>
    <td valign='top' nowrap>&nbsp;<html:link page="/viewuser.jspe" paramId="userid" paramName="reply" paramProperty="author.id"><bean:write name="reply" property="author.displayName"/></html:link>&nbsp;</td>
    <td valign='top'> <a href="<html:rewrite page="/showlog.jspe"/>?log_id=<bean:write name="reply" property="log.id"/>#<bean:write name="reply" property="id"/>" title="<bean:write name="reply" property="log.title"/>(<bean:write name="reply" property="log.replyCount"/>,<bean:write name="reply" property="log.viewCount"/>)"><bean:write name="reply" property="content" filter="false"/></a></td>
  </tr>
  </logic:iterate>
</table><br>
<%
	List users = UserManager.listUsersByDate(site, iYear,iMonth,iDate);
	pageContext.setAttribute("users", users);
	i = 1;
%>

<table border='0' width='100%' cellpadding='0' cellspacing='0'>
  <tr><td colspan=4><b><bean:message key="SHOWDATE_USER_TITLE" bundle="html" arg0="<%=String.valueOf(users.size())%>"/></b></td></tr>
  <tr><td colspan=4>&nbsp;</td></tr>
  <logic:iterate id="user" name="users">
  <tr <%if(i%2==0){%>bgcolor='#eeeeee'<%}%>>
  	<td valign='top'><%=(i++)%>.</td>
    <td valign='top'><html:link page="/viewuser.jspe" paramId="userid" paramName="user" paramProperty="id"><bean:write name="user" property="displayName"/></html:link></td>
    <td valign='top'><bean:write name="user" property="email"/></td>
    <td valign='top'><bean:write name="user" property="homePage"/></td>
    </tr>
  </logic:iterate>
</table>

⌨️ 快捷键说明

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