📄 setup.jsp
字号:
<%
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
%>
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ page import="java.io.*,java.sql.*,dlog4j.*"%>
<html>
<head>
<title>DLOG4J POST</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
</head>
<body>
<h2>DLOG4J POST RESULT:</h2>
<hr/>
<%
Connection conn = null;
try{
conn = ManagerBase.getConnection();
if(conn==null)
throw new SQLException();
%>
<font color=blue><b>Database connection test passed!</b></font>
<%
}catch(NullPointerException e){
%>
<font color=red><b>Cannot get database connection, please check the db configuration in struts-config.xml:</b></font></br>
<%
}catch(Exception e){
%>
<font color=red><b>Database connection test failed, detail is:</b></font></br>
<%
e.printStackTrace(new PrintWriter(out));
}finally{
if(conn!=null)
conn.close();
}
%>
<hr/>
<%
Mailer mailer = Mailer.getMailer();
if(mailer==null){
%>
<font color=red><b>Mail plugin test failed, no mail plugin has been configured.</b></font>
<%
}else{
try{
mailer.send("DLOG4J",new String[]{"liudong@mo168.com"},"DLOG4J POST","Just delete me. <br/> FROM " + request.getRequestURL());
%>
<font color=blue><b>Mail plugin test passed!</b></font>
<%
}catch(Exception e){
%>
<font color=red><b>Mail plugin test failed, detail is:</b></font></br>
<%
e.printStackTrace(new PrintWriter(out));
}
}%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -