index.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:4k
源码类别:
电子政务应用
开发平台:
Java
- <%
- /**
- * $RCSfile: index.jsp,v $
- * $Revision: 1.4 $
- * $Date: 2000/12/27 22:39:45 $
- */
- %>
- <%@ page
- import="java.util.*,
- java.text.*,
- com.coolservlets.forum.*,
- com.coolservlets.forum.util.*"
- errorPage="/mainctrl/bbs/error"
- %>
- <% // get parameters
- boolean logout = ParamUtils.getBooleanParameter(request, "logout");
- int forumID = ParamUtils.getIntParameter(request, "forum", -1);
- long lastVisited = SkinUtils.getLastVisited(request, response);
- %>
- <% // logout if requested:
- if (logout) {
- SkinUtils.removeUserAuthorization(request, response);
- response.sendRedirect("/mainctrl/bbs/index");
- return;
- }
- %>
- <% ////////////////////////
- // Authorization check
- // check for the existence of an authorization token
- Authorization authToken = SkinUtils.getUserAuthorization(request,response);
- // if the token was null, they're not authorized. Since this skin will
- // allow guests to view forums, we'll set a "guest" authentication
- // token
- if( authToken == null ) {
- authToken = AuthorizationFactory.getAnonymousAuthorization();
- }
- %>
- <% // get a forum factory and forum iterator
- ForumFactory forumFactory = ForumFactory.getInstance(authToken);
- Iterator forumIterator = forumFactory.forums();
- %>
- <% /////////////////
- // header include
- String title = "BBS论坛";
- %>
- <%@ include file="/skins/bay/header.jsp" %>
- <table cellpadding="0" bgcolor=#666666 cellspacing="0" border="0" width="100%">
- <tr>
- <td>
- <font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>>><a href="/mainctrl/communication/main"><font color="#FFFFFF">通信</font></a>>><a href="/mainctrl/bbs/index"><font color="#FFFFFF">论坛主页</font></a>>>铁通BBS论坛</font> </td>
- </tr>
- </table>
- <table cellpadding="0" bgcolor=#fafafa cellspacing="0" border="0" width="100%">
- <tr >
- <td width="1%"><img src="/skins/bay/images/blank.gif" width=30 height=1 border=0></td>
- <td width="98%" valign="top">
- <%-- begin main content --%>
- <br>
- <p>
- <% // check to see if there are no forums
- if( !forumIterator.hasNext() ) {
- %>
- <ul>
- 系统没有设置论坛,或者您没有权限访问任何论坛。
- </ul>
- <% } else { %>
- <table border="0" cellpadding="3" cellspacing="0">
- <% while( forumIterator.hasNext() ) {
- Forum forum = (Forum)forumIterator.next();
- int id = forum.getID();
- String name = forum.getName();
- String description = forum.getDescription();
- int numThreads = forum.getThreadCount();
- int numMessages = forum.getMessageCount();
- long lastModified= forum.getModifiedDate().getTime();
- %>
- <tr>
- <td width="1%" nowrap>
- <% if (lastModified > lastVisited) { %>
- <img src="/skins/bay/images/new.gif">
- <% } else { %>
- •
- <% } %>
- </td>
- <td width="99%">
- <font face="verdana" >
- <font class="strong"><a href="/mainctrl/bbs/viewForum?forum=<%= id %>" class="normal">
- <%= name %>
- </a></font>
- (<%= description %>)
- </font>
- <br>
- <font face="verdana" >
- (<%= numThreads %>主题,
- <%= numMessages %>帖子)
- </font>
- </td>
- </tr>
- <% } %>
- </table>
- <% } %>
- <%-- end main content --%>
- </td>
- <%-- recent dicussions --%>
- <td valign="top" width="1%">
- <table bgcolor="#999999" cellpadding="1" cellspacing="0" border="0" width="220">
- <td>
- <jsp:include page="/skins/bay/recentMessages.jsp" flush="true"/>
- </td>
- </table>
- </td>
- <%-- end recent dicussions --%>
- </tr>
- </table>
- <p>
- <%@ include file="/skins/bay/footer.jsp" %>