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

📄 _setup2__jsp.java

📁 JSP聊天系统
💻 JAVA
字号:
/*
 * JSP generated by Resin 2.1.2 (built Tue Jun 11 08:26:56 PDT 2002)
 */

package _admin._setup;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
import java.sql.*;
import org.ehotsoft.yekki.util.PropertyManager;
import org.ehotsoft.yekki.util.ParamUtil;
import org.ehotsoft.yekki.sql.ConnectionProvider;
import org.ehotsoft.yekki.sql.ConnectionManager;

public class _setup2__jsp extends com.caucho.jsp.JavaPage{
  private boolean _caucho_isDead;
  	
	private String[] getPropertyNames( ConnectionProvider conProvider ) {
		Enumeration enum = conProvider.propertyNames();
		Vector v = new Vector();
		while( enum.hasMoreElements() ) {
			v.addElement( enum.nextElement() );
		}
		String[] propNames = new String[ v.size() ];
		v.copyInto(propNames);
		return propNames;
	}	

  
  public void
  _jspService(javax.servlet.http.HttpServletRequest request,
              javax.servlet.http.HttpServletResponse response)
    throws java.io.IOException, javax.servlet.ServletException
  {
    com.caucho.jsp.QPageContext pageContext = (com.caucho.jsp.QPageContext) com.caucho.jsp.QJspFactory.create().getPageContext(this, request, response, null, true, 8192, true);
    javax.servlet.jsp.JspWriter out = (javax.servlet.jsp.JspWriter) pageContext.getOut();
    javax.servlet.ServletConfig config = getServletConfig();
    javax.servlet.Servlet page = this;
    javax.servlet.http.HttpSession session = pageContext.getSession();
    javax.servlet.ServletContext application = pageContext.getServletContext();
    response.setContentType("text/html");
    try {
      
/**
 * Yekki Setup Tool
 * November 28, 2000
 */

      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
      pageContext.write(_jsp_string0, 0, _jsp_string0.length);
       
	ConnectionProvider conProvider =  new ConnectionProvider();
	boolean error = false;
	String errorMessage = null;
	String[] propNames = getPropertyNames(conProvider);		
	String[] paramPropVals = new String[propNames.length];

	//Make sure the install has not already been completed.
	String setup = PropertyManager.getProperty("setup");
	if( setup != null && setup.equals("true") ) {
		error = true;
		errorMessage = "Yekki setup appears to have already been completed. If you'd like " +
			"to re-run this tool, delete the 'setup=true' property from your jive.properties " +
			"file.";
	}
	
	// get parameters:
	boolean setProps = ParamUtil.getBooleanParameter(request,"setProps");
		
	if( !error && setProps ) {
		
		for( int i=0; i<propNames.length; i++ ) {
			paramPropVals[i] = ParamUtil.getStringParameter(request,propNames[i]);
			if( paramPropVals[i] == null ) {
				paramPropVals[i] = "";
			}
		}
		
		for( int i=0; i < paramPropVals.length; i++ ) {
			conProvider.setProperty(propNames[i], paramPropVals[i]);
		}
		
		//Now test the connection. In this version of the install tool we test the driver name to make sure
		//it can be loaded. In the future, we might not want to do this in the generic case because the setup
		//tool needs to handle any possible connection provider setup. Perhaps we'll have specialized pages 
		//for the common connection providers.
		Connection con = null;
		String driver = null;
		try {
			driver = ParamUtil.getStringParameter(request, "driver");
			Class.forName(driver);
		}
		catch (ClassNotFoundException cnfe) {
			error = true;
			errorMessage = "Could not load JDBC driver: " + driver + ". Be sure that the driver is in the " +
				"classpath of your application server and then press the back button to try again.";
		}
		
		if (!error) {
			//Set the connection provider.
			ConnectionManager.setConnectionProvider(conProvider);
			
			try {
				con = ConnectionManager.getConnection();
				if (con == null) {
					error = true;
					errorMessage = "A connection to the database could not be made. Press the back button to " +
						"ensure that all fields were filled in properly.";
				}
			}
			catch (Exception e) {
				error = true;
			}
			finally {
				try {
					con.close();
				} catch( Exception ignored ) {}
			}
		}		
		if (!error) {
			// redirect
			response.sendRedirect("setup3.jsp");
			return;
		}
	}

      pageContext.write(_jsp_string1, 0, _jsp_string1.length);
      
	if (!error) {

      pageContext.write(_jsp_string2, 0, _jsp_string2.length);
       for( int i=0; i<propNames.length; i++ ) { 
			String prop = conProvider.getProperty(propNames[i]);
			String val = paramPropVals[i];
	
      pageContext.write(_jsp_string3, 0, _jsp_string3.length);
      	if( setProps ) { 
      pageContext.write(_jsp_string4, 0, _jsp_string4.length);
      out.print(( propNames[i] ));
      pageContext.write(_jsp_string5, 0, _jsp_string5.length);
      	} 
			else { 
      pageContext.write(_jsp_string6, 0, _jsp_string6.length);
      out.print(( propNames[i] ));
      pageContext.write(_jsp_string5, 0, _jsp_string5.length);
      	} 
      pageContext.write(_jsp_string7, 0, _jsp_string7.length);
      
			if( val == null ) {
				val = PropertyManager.getProperty("DbConnectionDefaultPool."+propNames[i]);
				if( val == null ) {
					val = "";
				}
			}
		
      pageContext.write(_jsp_string8, 0, _jsp_string8.length);
      out.print(( propNames[i] ));
      pageContext.write(_jsp_string9, 0, _jsp_string9.length);
      out.print(( val ));
      pageContext.write(_jsp_string10, 0, _jsp_string10.length);
      out.print(( conProvider.getPropertyDescription(propNames[i]) ));
      pageContext.write(_jsp_string11, 0, _jsp_string11.length);
       } 
      pageContext.write(_jsp_string12, 0, _jsp_string12.length);
      
	} //end no error
	else {

      pageContext.write(_jsp_string13, 0, _jsp_string13.length);
      out.print(( errorMessage ));
      pageContext.write(_jsp_string14, 0, _jsp_string14.length);
      
	} //end error

      pageContext.write(_jsp_string15, 0, _jsp_string15.length);
    } catch (java.lang.Throwable _jsp_e) {
      pageContext.handlePageException(_jsp_e);
    } finally {
      JspFactory.getDefaultFactory().releasePageContext(pageContext);
    }
  }

  private com.caucho.java.LineMap _caucho_line_map;
  private java.util.ArrayList _caucho_depends = new java.util.ArrayList();

  public boolean _caucho_isModified()
  {
    if (_caucho_isDead)
      return true;
    if (com.caucho.util.CauchoSystem.getVersionId() != 2057024144)
      return true;
    for (int i = _caucho_depends.size() - 1; i >= 0; i--) {
      com.caucho.vfs.Depend depend;
      depend = (com.caucho.vfs.Depend) _caucho_depends.get(i);
      if (depend.isModified())
        return true;
    }
    return false;
  }

  public long _caucho_lastModified()
  {
    return 0;
  }

  public com.caucho.java.LineMap _caucho_getLineMap()
  {
    return _caucho_line_map;
  }

  public void destroy()
  {
      _caucho_isDead = true;
      super.destroy();
  }

  public void init(com.caucho.java.LineMap lineMap,
                   com.caucho.vfs.Path appDir)
    throws javax.servlet.ServletException
  {
    com.caucho.vfs.Path resinHome = com.caucho.util.CauchoSystem.getResinHome();
    com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
    mergePath.addMergePath(appDir);
    mergePath.addMergePath(resinHome);
    mergePath.addClassPath(getClass().getClassLoader());
    _caucho_line_map = new com.caucho.java.LineMap("_setup2__jsp.java", "/admin/setup/setup2.jsp");
    _caucho_line_map.add(8, 1);
    _caucho_line_map.add(16, 19);
    _caucho_line_map.add(1, 45);
    _caucho_line_map.add(16, 53);
    _caucho_line_map.add(29, 54);
    _caucho_line_map.add(115, 131);
    _caucho_line_map.add(129, 135);
    _caucho_line_map.add(135, 142);
    _caucho_line_map.add(136, 144);
    _caucho_line_map.add(138, 147);
    _caucho_line_map.add(139, 149);
    _caucho_line_map.add(140, 151);
    _caucho_line_map.add(149, 162);
    _caucho_line_map.add(162, 168);
    _caucho_line_map.add(169, 173);
    _caucho_line_map.add(172, 175);
    com.caucho.vfs.Depend depend;
    depend = new com.caucho.vfs.Depend(mergePath.lookup("file:/e:/jnjt/admin/setup/setup2.jsp"), 1029909667136L, 5056L);
    _caucho_depends.add(depend);
  }

  private static byte []_jsp_string1;
  private static byte []_jsp_string11;
  private static byte []_jsp_string14;
  private static byte []_jsp_string5;
  private static byte []_jsp_string7;
  private static byte []_jsp_string15;
  private static byte []_jsp_string8;
  private static byte []_jsp_string4;
  private static byte []_jsp_string10;
  private static byte []_jsp_string6;
  private static byte []_jsp_string12;
  private static byte []_jsp_string2;
  private static byte []_jsp_string9;
  private static byte []_jsp_string13;
  private static byte []_jsp_string0;
  private static byte []_jsp_string3;
  static {
    _jsp_string1 = "\r\n\r\n<html>\r\n<head>\r\n	<title>Yekki Setup - Step 2</title>\r\n		<link rel=\"stylesheet\" href=\"style/global.css\">\r\n</head>\r\n\r\n<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#0000FF\" vlink=\"#800080\" alink=\"#FF0000\" background=\"../images/background.gif\">\r\n<p>\r\n\r\n".getBytes();
    _jsp_string11 = "</i></font></td>\r\n    </tr>\r\n    ".getBytes();
    _jsp_string14 = "\r\n	\r\n	</font>\r\n".getBytes();
    _jsp_string5 = "</font></td>\r\n      ".getBytes();
    _jsp_string7 = "\r\n      ".getBytes();
    _jsp_string15 = "\r\n\r\n<p>\r\n<hr size=\"0\">\r\n<center><font size=\"-1\"><i>www.coolservlets.com/jive</i></font></center>\r\n</body>\r\n</html>\r\n\r\n\r\n".getBytes();
    _jsp_string8 = "\r\n      <td>\r\n        <input type=\"text\" size=\"30\" name=\"".getBytes();
    _jsp_string4 = "\r\n      <td><font size=\"-1\" color=\"#ff0000\">".getBytes();
    _jsp_string10 = "\">\r\n      </td>\r\n      <td><font size=\"-1\"><i>".getBytes();
    _jsp_string6 = "\r\n      <td><font size=\"-1\">".getBytes();
    _jsp_string12 = "\r\n  </table>\r\n</ul>\r\n\r\n<center>\r\n<input type=\"submit\" value=\"Make Connection\">\r\n</center>\r\n</form>\r\n\r\n".getBytes();
    _jsp_string2 = "\r\n\r\n<b>Setup Your Database Connection</b>\r\n\r\n<ul>\r\n  Yekki needs to connect to a database in order to function properly. Fill in \r\n  the following fields with the connection information for your database. Note: \r\n  you should already have completed the import of the Yekki database schema as \r\n  outlined in the installation guide. \r\n  <p> <form action=\"setup2.jsp\" method=\"post\">\r\n  <input type=\"hidden\" name=\"setProps\" value=\"true\">\r\n  <table cellpadding=\"3\" cellspacing=\"0\" border=\"0\">\r\n    ".getBytes();
    _jsp_string9 = "\" value=\"".getBytes();
    _jsp_string13 = "\r\n	<font color=\"Red\">Error!</font>\r\n	<p><font size=2>\r\n	\r\n	".getBytes();
    _jsp_string0 = "\r\n\r\n".getBytes();
    _jsp_string3 = "\r\n    <tr> \r\n      ".getBytes();
  }
}

⌨️ 快捷键说明

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