📄 setup.jsp
字号:
<%@ page session="true" contentType="text/html; charset=GB2312" %>
<%
/**
* Title: Xerllent.net
* Description: 中国第五代(城域网-校园网)项目
* Copyright: Copyright (c) 2001
* Company: 赛灵通
* @author 宋新华
* @version 1.0
*/
%>
<%@ page import="java.io.*, java.util.*, java.lang.reflect.* "%>
<html>
<head>
<title>xerllent Setup</title>
<link rel="stylesheet" href="style/global.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<font size="5">Xerllent产品安装</font>
<hr size="0">
<p> <b>欢迎来到 Xerllent系列产品安装</b>
<p> 我们已经检测到您的系统需要为Xerllent软件安装时进行设置,这个工具将引导您连接您的数据库并建立系统管理员帐号。安装完毕后,您就可以使用Xerllent这个系统了。
<p> 如果您在安装过程中遇到难题,请将问题报告到<a href="mailto:songxh2@sina.com">songxh2@sina.com</a>
。如果今后您想重新设置您的数据库,请找到xerllent.properties文件里的setup属性,把"setup=true"改为"setup=false"。
<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> 您正在运行Java 2 或者更新版本的产品。</td>
</tr>
<%
}
else {
%>
<tr>
<td valign=top><img src="images/x.gif" width="13" height="13"></td>
<td> <font color="red"> 您的系统好像没有运行Java 2 或者更新的版本。这样,安装向导将不能继续,除非您更新您的Java平台版本,然后再运行本向导。</font></td>
</tr>
<%
}
%>
<%
//See if the xerllent classes are installed
boolean xerllentInstalled = true;
try {
Class.forName("net.xerllent.campus.campus");
}
catch (ClassNotFoundException cnfe) {
xerllentInstalled = false;
}
if (xerllentInstalled) {
%>
<tr>
<td valign=top><img src="images/check.gif" width="13" height="13"></td>
<td> Xerllent产品已经安装过了!</td>
</tr>
<%
}
else {
%>
<tr>
<td valign=top><img src="images/x.gif" width="13" height="13"></td>
<td> <font color="red"> Xerllent.net执行程序不能被加载,请参照安装说明书确定程序所需要的组件以及组件的安装路径"classpath"参数已经在您的服务器中设置正确。</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 (xerllentInstalled) {
%>
<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的程序不能被加载。请参照安装说明书确认Lucene组件以及安装路径"classpath"参数已经在您的服务器中设置正确。</font></td>
</tr>
<%
}
%>
<%
//Check status of xerllent.properties file. Because some servlet engines have seperate class
//loaders for JSP and other Java classes, we need to use the xerllent 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 campus classes.
boolean propError = false;
String errorMessage = null;
String path = null;
try {
Class propManager = Class.forName("net.xerllent.campus.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 = "Xerllent配置文件xerllent.properties加载成功。但是," +
"路径"path"属性没有设置导致程序无法将其他属性值存储到系统中,编辑属性文件的"path" " +
"域值,例如:'path=c:\\path\\to\\xerllent.properties' " +
"或者 'path=/path/to/xerllent.properties'.";
}
//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 = "Xerllent配置文件xerllent.properties加载成功,被发现在 "<code>" +
path + "</code>"。但是,对文件没有可写的权利。";
}
}
//The file doesn't exist
else {
propError = true;
errorMessage = "Xerllent配置文件xerllent.properties加载成功。但是,路径 "<code>" +
path + "</code>" 不存在。请编辑xerllent.properties文件确认 " +
"它的属性"+path+"值里所指向的路径在您的文件系统里存在。";
}
}
}
else {
propError = true;
errorMessage = "Xerllent配置文件xerllent.properties加载失败。请确认文件的classpath已经在您的服务器中正确设置!";
}
}
catch (Exception e) {
e.printStackTrace();
propError = true;
errorMessage = "这是一个在加载Xerllent配置文件时出现的常规错误。请确认您安装了最新的程序代码。";
}
if (!propError) {
%>
<tr>
<td valign=top><img src="images/check.gif" width="13" height="13"></td>
<td> Xerllent配置文件已经成功地加载,他的地址是:<%= path %>。</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 || !xerllentInstalled || !isJava2) {
%>
<font color="red"><b>一个和多个错误信息出现在您的安装检测报告单里。请更正它们,重新起动您的web服务器,然后执行本程序。</b></font>
<%
}
else {
%>
<form action="setup2.jsp" method=post>
<center>
<input type="submit" value="下一步>">
</center>
</form>
<%
}
%>
<p>
<hr size="0">
<center><font size="-1"><i>www.xerllent.cn</i></font></center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -