%@ page import="java.util.*, java.text.*, com.coolservlets.forum.*, com.coolservlets.forum.util.*" errorPage="error.jsp" %> <% // 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("index.jsp"); 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 = "Forum home page"; %> <%@ include file="header.jsp" %>
<%-- begin main content --%>
Forum home page<% // check to see if there are no forums if( !forumIterator.hasNext() ) { %>
|
<%-- recent dicussions --%>
|
<%-- end recent dicussions --%>
<%@ include file="footer.jsp" %>