setup4.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:4k
源码类别:
电子政务应用
开发平台:
Java
- <%
- /**
- * Jive Setup Tool
- * November 28, 2000
- */
- %>
- <%@ page import="java.io.*,
- java.util.*,
- java.sql.*,
- com.coolservlets.forum.*,
- com.coolservlets.forum.util.*,
- com.coolservlets.forum.database.*"%>
- <% try { %>
- <% boolean setupError = false;
- String errorMessage = "";
- //Make sure the install has not already been completed.
- String setup = PropertyManager.getProperty("setup");
- if( setup != null && setup.equals("true") ) {
- %>
- <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>
- <font color="Red">错误!</font>
- <p><font size=2>
- BBS设置已经完成,如果您想重新设置,请删除jive.properties配置文件中'setup=true'字段,然后再试。
- </font>
- <%
- }
- else {
- boolean error = false;
- String jiveHome = ParamUtils.getParameter(request,"jiveHome");
- if (jiveHome == null) {
- jiveHome = PropertyManager.getProperty("jiveHome");
- }
- boolean setJiveHome = ParamUtils.getBooleanParameter(request,"setJiveHome");
- //Look for error case, but only give a new error message if there isn't
- //already an error.
- if(setJiveHome && jiveHome == null ) {
- error = true;
- errorMessage = "您没有输入home路径,请输入home路径。";
- }
- %>
- <% if( !error && setJiveHome ) {
- // chomp a trailing "/" or "\"
- while( jiveHome.length() > 0
- && jiveHome.charAt(jiveHome.length()-1) == '/'
- || jiveHome.charAt(jiveHome.length()-1) == '\' )
- {
- jiveHome = jiveHome.substring(0,jiveHome.length()-1);
- }
- // check if the app server can write to that file
- File jiveHomeDir = new File(jiveHome);
- error = !jiveHomeDir.exists();
- if( error ) {
- errorMessage = "您输入的路径不存在,请检查您输入的路径!";
- } else {
- error = !jiveHomeDir.canRead();
- if( error ) {
- errorMessage = "您输入的路径存在,但您没有访问的权限,请修改你路径的设置!";
- } else {
- error = !jiveHomeDir.canWrite();
- if( error ) {
- errorMessage = "您输入的路径存在,但您没有路径写的权限,请修改您路径的设置!";
- } else {
- error = !jiveHomeDir.isAbsolute();
- errorMessage = "您应该输入一个绝对的路径!";
- }
- }
- }
- // at this point, the path exists and we can read & write to it
- // so create the file
- if( !error ) {
- // create the search directory
- File searchDir = new File( jiveHome + File.separator + "search" );
- if (!searchDir.exists()) {
- searchDir.mkdir();
- }
- // set the jiveHome property in the jive.properties file
- PropertyManager.setProperty("jiveHome",jiveHome);
- // redirect
- response.sendRedirect("setup5.jsp");
- return;
- }
- }
- %>
- <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="BBS设置" border="0">
- <hr size="0"><p>
- <b>BBS-Home路径</b>
- <ul>
- <font size="2">
- BBS论坛需要一个路径来存放文件系统的数据。这个路径成为论坛Home路径,这个步骤知道你创建这个路径。
- <p>
- 首先确定您的Home路径存在,如果不存在您需要创建一个,建议命名为"jiveHome",请确认您的应用服务器对此路径有读写的权限,然后将此路径的绝对路径输入到下面的输入框中。<p>
- <%
- if (error) {
- %>
- <font color="Red">错误:</font></font> <i><%= errorMessage %></i>
- <p>
- <% } %>
- <form action="setup4.jsp" method="post">
- <input type="hidden" name="setJiveHome" value="true">
- <table cellpadding="3" cellspacing="0" border="0">
- <tr>
- <td><font size="-1">BBS-Home:</font></td>
- <td><input type="text" size="50" name="jiveHome" value="<%= (jiveHome!=null)?jiveHome:"" %>"></td>
- </tr>
- </table>
- </ul>
- <center>
- <input type="submit" value="继续..">
- </center>
- </form>
- <% } //end else of setupError %>
- <p>
- <hr size="0">
- <center><font size="-1"><i>www.visionnex.com</i></font></center>
- </font>
- </body>
- </html>
- <% } catch (Exception e ) {
- e.printStackTrace();
- }
- %>