📄 setup.jsp
字号:
<%
/**
* Jive Setup Tool
* November 28, 2000
*/
%>
<%@ page import="java.io.*, java.util.*, java.lang.reflect.* "%>
<html>
<head>
<title>BBS设置程序</title>
<link rel="stylesheet" href="style/global.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<img src="images/setup.gif" width="210" height="38" alt="Jive Setup" border="0">
<hr size="0"><p>
<b>欢迎使用BBS设置程序</b>
<p>
程序已经检测到您的系统需要进行BBS设置,此程序将指导你建立系统的数据库链接并创建您的超级管理员帐户。
在设置完成之后,您就可以使用后台管理程序创建论坛组和使用此BBS系统。
<p>
如果你在使用安装程序时遇到问题,请联系
<a href="mailto:xuejiezhang@visionnex.com">xuejiezhang@visionnex.com</a>。
如果您在使用之后,想回到此设置程序,您只需将jive.properties配置文件中的
"setup=true"字段删除即可。
<p>
<b>设置项检查列表</b>
<ul>
<table border=0>
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
系统检查您的应用服务器系统为:<%= application.getServerInfo() %>。
</td></tr>
<%
//See if they have Java2 or later installed by trying to load java.util.HashMap.
boolean isJava2 = true;
try {
Class.forName("java.util.HashMap");
}
catch (ClassNotFoundException cnfe) {
isJava2 = false;
}
if (isJava2) {
%>
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
您使用了Java2或更高的版本。
</td></tr>
<%
}
else {
%>
<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td><td>
<font color="red">
您所使用的Java的版本低于系统要求的版本,所以请升级您Java的版本之后再进行BBS设置。
</font>
</td></tr>
<%
}
%>
<%
//See if the Jive classes are installed
boolean jiveInstalled = true;
try {
Class.forName("com.coolservlets.forum.Forum");
}
catch (ClassNotFoundException cnfe) {
jiveInstalled = false;
}
if (jiveInstalled) {
%>
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
BBS所需要的文件已经安装。
</td></tr>
<%
}
else {
%>
<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td><td>
<font color="red">
设置程序无法装载系统所需要的文件,请检查BBS系统所需要的类文件是否在classpath中,检查无误后,重新启动Application Server再试一遍。
</font>
</td></tr>
<%
}
%>
<%
//See if the Lucene classes are installed
boolean luceneInstalled = true;
try {
Class.forName("com.lucene.document.Document");
}
catch (ClassNotFoundException cnfe) {
luceneInstalled = false;
}
if (jiveInstalled) {
%>
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
Lucene应用文件已经安装。
</td></tr>
<%
}
else {
%>
<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td><td>
<font color="red">
系统无法装载Lucene应用文件,请检查BBS文件,再试一下。
</font>
</td></tr>
<%
}
%>
<%
//Check status of jive.properties file. Because some servlet engines have seperate class
//loaders for JSP and other Java classes, we need to use the Jive PropertyManager to
//get the properties. We use reflection to call methods on PropertyManager so that we don't
//have to do an import of that class and screw up the error messages for failure to load Jive classes.
boolean propError = false;
String errorMessage = null;
String path = null;
try {
Class propManager = Class.forName("com.coolservlets.forum.PropertyManager");
Method propReadable = propManager.getMethod("propertyFileIsReadable", null);
if ( ((Boolean)propReadable.invoke(null,null)).booleanValue() ) {
//Now, get property
Method getProperty = propManager.getMethod("getProperty", new Class[] { Class.forName("java.lang.String") } );
path = (String)getProperty.invoke(null, new Object[] { "path" } );
if (path == null || path.equals("")) {
propError = true;
errorMessage = "配置文件jive.properties成功装载。但是配置文件中Path的值与配置文件所处的路径不相符。请检查您的配置文件";
}
//Otherwise, see if the file exists
else {
Method propExists = propManager.getMethod("propertyFileExists", null);
if ( ((Boolean)propExists.invoke(null,null)).booleanValue() ) {
//See if we can write to the file
Method propWritable = propManager.getMethod("propertyFileIsWritable", null);
if ( !((Boolean)propWritable.invoke(null,null)).booleanValue() ) {
propError = true;
errorMessage = "配置文件jive.properties成功装载。路径: "<code>" +
path + "</code>"。但是应用服务器没有对此文件赋予写的权限。";
}
}
//The file doesn't exist
else {
propError = true;
errorMessage = "配置文件jive.properties成功装载。但是路径: "<code>" +
path + "</code>" 不存在,请重新配置您的配置文件。";
}
}
}
else {
propError = true;
errorMessage = "配置文件jive.properties不存在,请确认配置文件存在于应用服务器的classpath中。";
}
}
catch (Exception e) {
e.printStackTrace();
propError = true;
errorMessage = "在装载jive.properties配置文件时发生错误。请检查您的配置文件。";
}
if (!propError) {
%>
<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
位于:<%= path %>的配置文件jive.properties成功装载。
</td></tr>
<%
}
else {
%>
<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td><td>
<font color="red">
<%= errorMessage %>
</font>
</td></tr>
<%
}
%>
</table>
</ul>
<%
if (propError || !jiveInstalled || !isJava2) {
%>
<font color="red"><b>在设置程序检查项中,发生一些错误,请纠正他们,然后重新启动应用服务器,然后再进行设置。</b></font>
<%
}
else {
%>
</font>
<form action="setup2.jsp" method=post>
<center>
<input type="submit" value="下一步..">
</center>
<%
}
%>
<p>
<hr size="0">
<center><font size="-1"><i>www.visionnex.com</i></font></center>
</font>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -