⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setup.jsp

📁 一套完整的工商12315的源程序jsp部分在12315里,后台JAVA部分在gs12315src里,没有打包数据库.
💻 JSP
字号:
<%
/**
 * TechWeb2 Setup Tool
 * November 28, 2000
 */
%>

<%@ page import="java.io.*, java.util.*, java.lang.reflect.* "%>
<html>
	<head>	<META HTTP-EQUIV="Pragma" CONTENT="no-cache">  
	<title>TechWeb2 Setup</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="TechWeb2 Setup" border="0">

<hr size="0"><p>

<b>Welcome to TechWeb2 Setup</b>
<p>

We've detected that your system needs to be setup for TechWeb2. This tool will
guide you through making a connection to your database and setting up an administrator
account. After completing setup, you'll be able to use the admin tool to create
forums and start using TechWeb2.
<p>
If you encounter problems with the setup process, please report them to 
<a href="mailto:stby@sina.com">stby@sina.com</a>.
If you'd like to return here at some point in the future after
completing the intial setup, delete the 
"setup=true" field from your ioffice.properties file.
<p>
<b>Setup Checklist</b>
<ul>
<table border=0>
		
	<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
		Setup has detected that you are running <%= 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>
		You are running Java 2 or later.
	</td></tr>
	<%
		}
		else {
	%>
	<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td><td>
		<font color="red">
		You do not appear to be running Java 2 or later. Therefore, setup cannot continue. 
		If possible, upgrade your version of Java and restart this process.
		</font>
	</td></tr>	
	<%
		}
	%>
	
	<%
		//See if the TechWeb2 classes are installed
		boolean classInstalled = true;
		try {
			Class.forName("com.powerrun.ioffice.IofficeFactory");
		}
		catch (ClassNotFoundException cnfe) {
			classInstalled = false;
		}
		if (classInstalled) {
	%>
	<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
		The TechWeb2 application files are installed.
	</td></tr>
	<%
		}
		else {
	%>
	<tr><td valign=top><img src="images/x.gif" width="13" height="13"></td><td>
		<font color="red">
		The TechWeb2 application files could not be loaded. Follow the installation documentation
		instructions and ensure that the class files are in the classpath of your
		application server.
		</font>
	</td></tr>	
	<%
		}
	%>
		
		
	<%
		//Check status of ioffice.properties file. Because some servlet engines have seperate class
		//loaders for JSP and other Java classes, we need to use the TechWeb2 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 TechWeb2 classes.
		
		boolean propError = false;
		String errorMessage = null;
		String path = null;
		try {
			Class propManager = Class.forName("com.powerrun.ioffice.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 = "The TechWeb2 properties were successfully loaded. However, the " +
						"path field was not set which prevents TechWeb2 from being able to save " +
						"properties to the filesystem. Edit the properties file and add a path " +
						"field that looks something like: 'path=c:&#92;&#92;path&#92;&#92;to&#92;&#92;ioffice.properties' " +
						"or 'path=/path/to/ioffice.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 = "The TechWeb2 properties were successfully loaded and found at &quot;<code>" +
								path + "</code>&quot;. However, the application server does not have write permission " +
								"on the file.";
						}
					}
					//The file doesn't exist
					else {
						propError = true;
						errorMessage = "The TechWeb2 properties were successfully loaded. However, the path &quot;<code>" +
							path + "</code>&quot; does not appear to exist. Edit the ioffice.properties file and make sure " +
							"that the path field points to exactly where the properties file exists on your " +
							"filesystem.";
					}
				}
        	}
        	else {
           		propError = true;
           		errorMessage = "The ioffice.properties file could not be loaded. Make sure that it is " +
					"in the classpath of your application server.";
        	}
		}
		catch (Exception e) {
			e.printStackTrace();
			propError = true;
           	errorMessage = "There was a general error loading the TechWeb2 properties. Be sure that you " +
				"have installed the latest TechWeb2 code.";
		}
		if (!propError) {
	%>
	<tr><td valign=top><img src="images/check.gif" width="13" height="13"></td><td>
		The TechWeb2 properties were successfully loaded and found at <%= 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 || !classInstalled || !isJava2) {
%>
	<font color="red"><b>One or more errors occured in the initial setup checklist. Please correct 
	them, restart your application server, and then reload this page.</b></font>
<%
	}
	else {
%>
</font>

<form action="setup2.jsp" method=post>

<center>
<input type="submit" value="Continue &gt;">
</center>

<%
	}
%>

<p>
<hr size="0">
<center><font size="-1"><i>Stone Powerrun Software Techonology Co.</i></font></center>
</font>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -