index.jsp
来自「Jive是基于JSP/JAVA技术构架的一个大型BBS论坛系统,这是Jive论坛」· JSP 代码 · 共 163 行
JSP
163 行
<%/** * $RCSfile: index.jsp,v $ * $Revision: 1.3 $ * $Date: 2002/04/03 18:48:18 $ */%><%@ page import="java.io.*, java.lang.reflect.*, java.util.*"%> <% // Jive installation check. Load the Jive classes by reflection because // the Jive classes may or may not be installed. boolean doSetup = false; boolean configurationError = false; String jiveEdition = "Jive Forums Basic"; // Try loading a Jive class: try { Class jiveGlobals = Class.forName("com.jivesoftware.forum.JiveGlobals"); // authorization class used below Class authorization = Class.forName("com.jivesoftware.forum.Authorization"); Class[] params = new Class[1]; params[0] = "".getClass(); Method getJiveProperty = jiveGlobals.getMethod("getJiveProperty", params); if (getJiveProperty == null) { doSetup = true; } else { // Call JiveGlobals.getJiveProperty("setup") String[] args = {"setup"}; Object setupVal = getJiveProperty.invoke(null, args); if (setupVal == null) { doSetup = true; } else { String setup = (String)setupVal; if (!"true".equals(setup)) { doSetup = true; } } } Field jivePro = jiveGlobals.getField("PROFESSIONAL"); Field jiveEnt = jiveGlobals.getField("ENTERPRISE"); int jiveProValue = jivePro.getInt(jiveGlobals); int jiveEntValue = jiveEnt.getInt(jiveGlobals); Method getJiveEdition = jiveGlobals.getMethod("getJiveEdition", null); int edition = ((Integer)getJiveEdition.invoke(null, null)).intValue(); if (edition == jiveProValue) { jiveEdition = "Jive Forums Professional"; } else if (edition == jiveEntValue) { jiveEdition = "Jive Forums Enterprise"; } else { jiveEdition = "Jive Forums Basic"; } } catch (Exception e) { e.printStackTrace(); doSetup = true; } catch (Throwable t) { // catch run time errors, like class loader issues (usually happens // if the jiveHome path is configured incorrectly, etc) configurationError = true; } // If we need to run the Jive setup tool, give the user a link to the setup // tool. if (doSetup || configurationError) { %> <html> <head> <title><%= jiveEdition %> - Admin</title> </head> <body> <font face="arial,helvetica,sans-serif" color="#333333"> <b><%= jiveEdition %> - Admin</b> </font> <ul> <font size="-1" face="arial,helvetica,sans-serif"> <% if (doSetup) { %> Jive is not properly configured or is being run for the first time. <p> <a href="setup/index.jsp">Proceed to the setup tool</a> <% } %> <% if (configurationError) { %> A general exception occurred. This could be because Jive is not setup correctly, specifically, Jive might not be able to find your <font color="#336600">jiveHome</font> directory as indicated in the <font color="#336600">jive_init.properties</font> file. Please consult the installation documentation before you try to correct the problem. Remember, you will need to restart your appserver if you make changes to the <font color="#336600">jive_init.properties</font> file. <% } %> </font> </ul> </body> </html><% // for some reason, we have to call flush.. some app servers won't // display the above html w/o flushing the stream out.flush(); return; } // Check to see if we've already logged into this tool. com.jivesoftware.forum.Authorization authToken = (com.jivesoftware.forum.Authorization)session.getAttribute("jive.admin.authorization"); if (authToken == null) { response.sendRedirect("login.jsp"); return; } // License check com.jivesoftware.forum.LicenseManager.validateLicense("Jive Forums Basic","2.0"); // logout if requested: if ("true".equals(request.getParameter("logout"))) { try { List removables = new ArrayList(10); for (Enumeration enum=session.getAttributeNames(); enum.hasMoreElements();) { String attribName = (String)enum.nextElement(); if (attribName.startsWith("jive.admin.") || attribName.startsWith("admin.")) { removables.add(attribName); } } for (int i=0; i<removables.size(); i++) { session.removeAttribute((String)removables.get(i)); } } catch (IllegalStateException ignored) { // if session is already invalid } finally { response.sendRedirect("index.jsp"); return; } }%><html><head><title><%= jiveEdition %> - Admin</title></head><frameset rows="100,*" bordercolor="#0099cc" border="0" frameborder="0" framespacing="0" style="background-color:#0099cc"> <frame src="tabs.jsp" name="header" scrolling="no" marginheight="0" marginwidth="0" noresize> <frameset cols="175,*" bordercolor="#0099cc" border="0" frameborder="0" style="background-color:#0099cc"> <frame src="sidebar.jsp" name="sidebar" scrolling="auto" marginheight="0" marginwidth="0" noresize> <frameset rows="*" bordercolor="#0099cc" border="0" frameborder="0" style="background-color:#0099cc"> <frame src="main.jsp" name="main" scrolling="auto" noresize> </frameset> </frameset></frameset></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?