?? setup.jsp
字號:
<%@ page contentType="text/html;charset=ISO8859_1" %>
<%
/**
* $RCSfile: setup.jsp,v $
* $Revision: 1.1.1.1 $
* $Date: 2002/09/09 13:50:21 $
*
* Copyright (C) 1999-2001 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
%>
<%@ page import="java.io.*,
java.util.*,
java.lang.reflect.*"
%>
<%@ include file="global.jsp" %>
<%@ include file="header.jsp" %>
<table cellpadding="6" cellspacing="0" border="0" width="100%">
<tr>
<td width="1%" valign="top">
<% // set sidebar properties
session.setAttribute("sidebar.0.active", new Boolean(true));
if (!GREEN.equals(getSessionString(session,"sidebar.0.light"))) {
session.setAttribute("sidebar.0.light", YELLOW);
}
%>
<%@ include file="sidebar.jsp" %>
</td>
<td width="99%" valign="top">
<b>歡迎使用Jive論壇!</b>
<hr size="0">
<font size="-1">
在安裝繼續進行前,你的服務器環境必須通過以下所有檢查:
</font>
<ul>
<table border="0">
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td>
<td>
<font size="-1">
安裝工具檢測到你正運行在
<%= application.getServerInfo() %>上
</font>
</td>
</tr>
<% // JDK check. See if they have Java2 or later installed by trying to
// load java.util.HashMap.
boolean isJDK1_2 = true;
try {
Class.forName("java.util.HashMap");
}
catch (ClassNotFoundException cnfe) {
isJDK1_2 = false;
}
if (isJDK1_2) {
%>
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td>
<td>
<font size="-1">
你的JDK版本為1.2或者更新。
</font>
</td>
</tr>
<% }
else {
%>
<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td>
<td>
<font size="-1">
你的JDK版本好像低于JDK 1.2。因此安裝不能繼續。如果可能,請更新JDK版本并重新開始這個過程。
</font>
</td>
</tr>
<% }
// Servlet version check. The appserver must support at least support
// the Servlet API 2.2.
boolean servlet2_2 = true;
try {
Class sessionClass = session.getClass();
Class[] setAttributeParams = new Class[1];
setAttributeParams[0] = Class.forName("java.lang.String");
Method getAttributeMethod = sessionClass.getMethod("getAttribute", setAttributeParams);
}
catch (SecurityException se) {
// some class loaders might not let us do the reflection above, so use
// the old method of finding the appserver version:
servlet2_2 = application.getMajorVersion() >= 2
&& application.getMinorVersion() >= 2;
}
catch (Exception e) {
// ClassNotFoundException & MethodNotFoundException end up here.
servlet2_2 = false;
}
if (servlet2_2) {
%>
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td>
<td>
<font size="-1">
你的應用服務器支持servlet 2.2或者更新。
</font>
</td>
</tr>
<% }
else {
%>
<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td><td>
<font size="-1">你的應用服務器不支持servlet 2.2或者更新。</font>
</td></tr>
<%
}
%>
<%
// Jive
boolean jiveInstalled = true;
try { Class.forName("com.jivesoftware.forum.Forum"); }
catch (ClassNotFoundException cnfe) { jiveInstalled = false; }
// Lucene
boolean luceneInstalled = true;
try { Class.forName("org.apache.lucene.document.Document"); }
catch (ClassNotFoundException cnfe) { luceneInstalled = false; }
// Lucene Chinese support
boolean luceneChineseInstalled = true;
try { Class.forName("org.apache.lucene.analysis.cn.ChineseAnalyzer"); }
catch (ClassNotFoundException cnfe) { luceneChineseInstalled = false; }
// JavaMail
boolean javaMailInstalled = true;
try {
Class.forName("javax.mail.Address"); // mail.jar
Class.forName("javax.activation.DataHandler"); // activation.jar
Class.forName("dog.mail.nntp.Newsgroup"); // nntp.jar
}
catch (ClassNotFoundException cnfe) { javaMailInstalled = false; }
// JDBC std ext
boolean jdbcExtInstalled = true;
try { Class.forName("javax.sql.DataSource"); }
catch (ClassNotFoundException cnfe) { jdbcExtInstalled = false; }
boolean filesOK = jiveInstalled && luceneInstalled && javaMailInstalled &&
jdbcExtInstalled;
if (filesOK) {
%>
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
<font size="-1">所有的應用程序包都安裝正確。
<% }
else {
%>
<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td><td>
<font size="-1">一個或者多個應用程序包沒有被安裝。
<% } %>
<% if (luceneChineseInstalled) {
%>
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
<font size="-1">支持中文檢索的lucene包安裝正確。
<% }
else {
%>
<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td><td>
<font size="-1">中文檢索支持lucene包安裝不正確,這不會影響論壇的基本使用,但是不能進行中文的檢索甚至在進行中文檢索時會出現錯誤!推薦你升級你的lucene包。
<% } %>
<ul>
<img src="images/<%= jiveInstalled?"check.gif":"x.gif" %>" width="13" height="13">
Jive論壇內核 (jive.jar)
<br> <img src="images/<%= luceneInstalled?"check.gif":"x.gif" %>" width="13" height="13">
文本搜索引擎Lucene (lucene.jar)(中文支持)
<br> <img src="images/<%= javaMailInstalled?"check.gif":"x.gif" %>" width="13" height="13">
JavaMail和NNTP支持 (mail.jar, activation.jar, nntp.jar)
<br> <img src="images/<%= jdbcExtInstalled?"check.gif":"x.gif" %>" width="13" height="13">
JDBC 2.0 擴展 (jdbc2_0-stdext.jar)
</ul>
</font>
</td></tr>
<%
//Check the status of JiveHome
boolean propError = false;
String errorMessage = null;
String jiveHome = null;
try {
Class jiveGlobals = Class.forName("com.jivesoftware.forum.JiveGlobals");
Method getJiveHome = jiveGlobals.getMethod("getJiveHome", null);
jiveHome = (String)getJiveHome.invoke(null, null);
if (jiveHome != null) {
// See if the jiveHome directory actually exists
try {
File file = new File(jiveHome);
if (!file.exists()) {
propError = true;
errorMessage = "目錄 <tt>" + jiveHome + "</tt> " +
"不存在。請編輯 <tt>jive_init.properties</tt> 文件" +
"指定正確的jiveHome目錄。";
}
}
catch (Exception e) {}
if (!propError) {
// See if jiveHome is readable and writable.
Method jiveHomeReadable = jiveGlobals.getMethod("isJiveHomeReadable", null);
boolean readable = ((Boolean)jiveHomeReadable.invoke(null, null)).booleanValue();
if (!readable) {
propError = true;
errorMessage = "<tt>jiveHome</tt> 存在于<tt>" + jiveHome +
"</tt>, 但是你的應用服務器沒有對它的讀權限。請設置目錄的權限修正此問題。";
}
Method jiveHomeWritable = jiveGlobals.getMethod("isJiveHomeWritable", null);
boolean writable = ((Boolean)jiveHomeWritable.invoke(null, null)).booleanValue();
if (!writable) {
propError = true;
errorMessage = "<tt>jiveHome</tt> 存在于<tt>" + jiveHome +
"</tt>, 但是你的應用服務器沒有對它的寫權限。請設置目錄的權限修正此問題。";
}
// Jive Home appears to exist and to be setup correctly. Make sure that all of the proper sub-dirs exist
// or create them as necessary.
File homeFile = new File(jiveHome);
String [] subDirs = new String [] { "search", "logs", "data" };
for (int i=0; i<subDirs.length; i++) {
File subDir = new File(jiveHome, subDirs[i]);
if (!subDir.exists()) {
subDir.mkdir();
}
}
}
}
else {
propError = true;
errorMessage = "<tt>jiveHome</tt> 目錄設置不正確。請參考安裝文檔正確設置 <tt>jive_init.properties</tt> 文件中的值。";
}
}
catch (Exception e) {
e.printStackTrace();
propError = true;
errorMessage = "檢查<tt>jiveHome</tt>目錄時發生異常。" +
"請確認你安裝的是最新的Jive論壇";
}
if (!propError) {
%>
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
<tt>jiveHome</tt> <font size="-1">目錄正確配置于: </font><tt><%= jiveHome %></tt>.
</td></tr>
<%
}
else {
%>
<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td><td>
<font size="-1"><%= errorMessage %><font>
</td></tr>
<%
}
%>
</table>
</ul>
<%
if (propError || !filesOK || !isJDK1_2 || !servlet2_2) {
%>
<font color="red" size="-1"><b>安裝初始化檢查過程中發現錯誤,請更正,然后重新啟動服務器重新開始安裝過程。</b></font>
<%
}
else {
// everything is ok, so update the sidebar variables in the session:
session.setAttribute("sidebar.0.light", GREEN);
%>
</font>
<form action="setup2.jsp">
<hr size="0">
<div align="center">
<input type="submit" value="繼續">
</form>
</div>
<%
}
%>
<%@ include file="footer.jsp" %>
</td>
</tr>
</table>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -