📄 _setup2__jsp.java
字号:
/*
* JSP generated by Resin 2.1.4 (built Fri Aug 2 14:16:52 PDT 2002)
*/
package _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;charset=gb2312");
request.setCharacterEncoding("GB2312");
try {
pageContext.write(_jsp_string0, 0, _jsp_string0.length);
pageContext.write(_jsp_string1, 0, _jsp_string1.length);
pageContext.write(_jsp_string1, 0, _jsp_string1.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 安装已经完成.如果你想" +
"重新运行本工具, 须从Yekki属性中删除'setup=true'" +
"文件.";
}
// 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 = "不能装载JDBC驱动程序: " + driver + ".确认此驱动程序是否在" +
"你的应用程序服务器的类路径中并按后退按纽,重新试一次.";
}
if (!error) {
//Set the connection provider.
ConnectionManager.setConnectionProvider(conProvider);
try {
con = ConnectionManager.getConnection();
if (con == null) {
error = true;
errorMessage = "没有实现与数据库的连接. 按后退按纽 " +
"确认所有的域已填完.";
}
}
catch (Exception e) {
error = true;
}
finally {
try {
con.close();
} catch( Exception ignored ) {}
}
}
if (!error) {
// redirect
response.sendRedirect("setup3.jsp");
return;
}
}
pageContext.write(_jsp_string2, 0, _jsp_string2.length);
if (!error) {
pageContext.write(_jsp_string3, 0, _jsp_string3.length);
for( int i=0; i<propNames.length; i++ ) {
String prop = conProvider.getProperty(propNames[i]);
String val = paramPropVals[i];
pageContext.write(_jsp_string4, 0, _jsp_string4.length);
if( setProps ) {
pageContext.write(_jsp_string5, 0, _jsp_string5.length);
out.print(( propNames[i] ));
pageContext.write(_jsp_string6, 0, _jsp_string6.length);
}
else {
pageContext.write(_jsp_string7, 0, _jsp_string7.length);
out.print(( propNames[i] ));
pageContext.write(_jsp_string6, 0, _jsp_string6.length);
}
pageContext.write(_jsp_string8, 0, _jsp_string8.length);
if( val == null ) {
val = PropertyManager.getProperty("DbConnectionDefaultPool."+propNames[i]);
if( val == null ) {
val = "";
}
}
pageContext.write(_jsp_string9, 0, _jsp_string9.length);
out.print(( propNames[i] ));
pageContext.write(_jsp_string10, 0, _jsp_string10.length);
out.print(( val ));
pageContext.write(_jsp_string11, 0, _jsp_string11.length);
out.print(( conProvider.getPropertyDescription(propNames[i]) ));
pageContext.write(_jsp_string12, 0, _jsp_string12.length);
}
pageContext.write(_jsp_string13, 0, _jsp_string13.length);
} //end no error
else {
pageContext.write(_jsp_string14, 0, _jsp_string14.length);
out.print(( errorMessage ));
pageContext.write(_jsp_string15, 0, _jsp_string15.length);
} //end error
pageContext.write(_jsp_string16, 0, _jsp_string16.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() != 2057024146)
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", "/setup/setup2.jsp");
_caucho_line_map.add(2, 1);
_caucho_line_map.add(10, 19);
_caucho_line_map.add(1, 46);
_caucho_line_map.add(10, 48);
_caucho_line_map.add(23, 49);
_caucho_line_map.add(109, 126);
_caucho_line_map.add(120, 130);
_caucho_line_map.add(126, 137);
_caucho_line_map.add(127, 139);
_caucho_line_map.add(129, 142);
_caucho_line_map.add(130, 144);
_caucho_line_map.add(131, 146);
_caucho_line_map.add(140, 157);
_caucho_line_map.add(153, 163);
_caucho_line_map.add(160, 168);
_caucho_line_map.add(163, 170);
com.caucho.vfs.Depend depend;
depend = new com.caucho.vfs.Depend(mergePath.lookup("doc/setup/setup2.jsp"), 1029982536000L, 4689L);
_caucho_depends.add(depend);
}
private static byte []_jsp_string2;
private static byte []_jsp_string12;
private static byte []_jsp_string13;
private static byte []_jsp_string15;
private static byte []_jsp_string6;
private static byte []_jsp_string0;
private static byte []_jsp_string8;
private static byte []_jsp_string9;
private static byte []_jsp_string5;
private static byte []_jsp_string11;
private static byte []_jsp_string3;
private static byte []_jsp_string7;
private static byte []_jsp_string16;
private static byte []_jsp_string10;
private static byte []_jsp_string14;
private static byte []_jsp_string1;
private static byte []_jsp_string4;
static {
try {
_jsp_string2 = "\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("GB2312");
_jsp_string12 = "</i></font></td>\r\n </tr>\r\n ".getBytes("GB2312");
_jsp_string13 = "\r\n </table>\r\n</ul>\r\n\r\n<center>\r\n <input type=\"submit\" value=\"建立连接\">\r\n</center>\r\n</form>\r\n\r\n".getBytes("GB2312");
_jsp_string15 = "\r\n \r\n </font>\r\n".getBytes("GB2312");
_jsp_string6 = "</font></td>\r\n ".getBytes("GB2312");
_jsp_string0 = "\r\n".getBytes("GB2312");
_jsp_string8 = "\r\n ".getBytes("GB2312");
_jsp_string9 = "\r\n <td>\r\n <input type=\"text\" size=\"30\" name=\"".getBytes("GB2312");
_jsp_string5 = "\r\n <td><font size=\"-1\" color=\"#ff0000\">".getBytes("GB2312");
_jsp_string11 = "\">\r\n </td>\r\n <td><font size=\"-1\"><i>".getBytes("GB2312");
_jsp_string3 = "\r\n\r\n<b>安装数据库连接</b>\r\n\r\n<ul>\r\n 为了功能完全的实现,Yekki 需要连接一个数据库.在下面域中填写数据库连接信息, 注意:在安装向导中你应该已经完成引入Yekki数据库的计划. \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("GB2312");
_jsp_string7 = "\r\n <td><font size=\"-1\">".getBytes("GB2312");
_jsp_string16 = "\r\n\r\n<p>\r\n<hr size=\"0\">\r\n<center><font size=\"-1\"><i>www.coolservlets.com/Yekki</i></font></center>\r\n</body>\r\n</html>\r\n\r\n\r\n".getBytes("GB2312");
_jsp_string10 = "\" value=\"".getBytes("GB2312");
_jsp_string14 = "\r\n <font color=\"Red\">Error!</font>\r\n <p><font size=2>\r\n \r\n ".getBytes("GB2312");
_jsp_string1 = "\r\n\r\n".getBytes("GB2312");
_jsp_string4 = "\r\n <tr> \r\n ".getBytes("GB2312");
} catch (java.io.UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -