📄 show_0002ejsp_jsp.java
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class show_0002ejsp_jsp extends HttpJspBase {
// begin [file="/show.jsp";from=(5,0);to=(5,79)]
// end
static {
}
public show_0002ejsp_jsp( ) {
}
private static boolean _jspx_inited = false;
public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
String _value = null;
try {
if (_jspx_inited == false) {
synchronized (this) {
if (_jspx_inited == false) {
_jspx_init();
_jspx_inited = true;
}
}
}
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/show.jsp";from=(0,98);to=(5,0)]
out.write("\r\n<html>\r\n<head>\r\n<title>用户留言</title>\r\n</head>\r\n");
// end
// begin [file="/show.jsp";from=(5,0);to=(5,79)]
com.test.DB.DBConnManager dbManage = null;
boolean _jspx_specialdbManage = false;
synchronized (session) {
dbManage= (com.test.DB.DBConnManager)
pageContext.getAttribute("dbManage",PageContext.SESSION_SCOPE);
if ( dbManage == null ) {
_jspx_specialdbManage = true;
try {
dbManage = (com.test.DB.DBConnManager) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "com.test.DB.DBConnManager");
} catch (ClassNotFoundException exc) {
throw new InstantiationException(exc.getMessage());
} catch (Exception exc) {
throw new ServletException (" Cannot create bean of class "+"com.test.DB.DBConnManager", exc);
}
pageContext.setAttribute("dbManage", dbManage, PageContext.SESSION_SCOPE);
}
}
if(_jspx_specialdbManage == true) {
// end
// begin [file="/show.jsp";from=(5,0);to=(5,79)]
}
// end
// HTML // begin [file="/show.jsp";from=(5,79);to=(6,0)]
out.write("\r\n");
// end
// begin [file="/show.jsp";from=(6,0);to=(6,48)]
JspRuntimeLibrary.introspect(pageContext.findAttribute("dbManage"), request);
// end
// HTML // begin [file="/show.jsp";from=(6,48);to=(9,0)]
out.write("\r\n<body background=\"bj.gif\">\r\n<br>\r\n");
// end
// begin [file="/show.jsp";from=(9,2);to=(18,0)]
//String realname=request.getParameter("realname");
//String realemail=request.getParameter("realemail");
//System.out.println("name="+realname);
//System.out.println("email="+realemail);
Connection con=dbManage.getConnection("access");
System.out.println("数据库连接成功");
if(con==null)
{
// end
// HTML // begin [file="/show.jsp";from=(18,2);to=(19,0)]
out.write("对不起,现在数据库忙,请稍后再试\r\n");
// end
// begin [file="/show.jsp";from=(19,2);to=(24,0)]
}
Statement stmt=con.createStatement();
String sql = "select * from liuyan order by id desc";
ResultSet rs = stmt.executeQuery(sql);
// end
// HTML // begin [file="/show.jsp";from=(24,2);to=(49,0)]
out.write("\r\n<script language=\"JavaScript\">\r\nfunction openw(url) {\r\n var newwin=window.open(url,\"NewWin\",\"toolbar=no,resizable=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,top=220,left=220,width=500,height=330\");\r\n // newwin.focus();\r\n return false;\r\n}\r\nfunction opend(url) {\r\n var newwin=window.open(url,\"NewWin\",\"toolbar=no,resizable=yes,location=no,directories=no,status=no,menubar=no,scrollbars=no,top=100,left=50,width=650,height=350\");\r\n // newwin.focus();\r\n return false;\r\n}\r\n</script>\r\n\r\n <table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">\r\n <tr>\r\n <td width=\"50%\">\r\n <div align=\"center\">\r\n <a href=\"add.jsp\">我要留言</a>\r\n </div>\r\n </td>\r\n\r\n </tr>\r\n </table>\r\n\r\n");
// end
// begin [file="/show.jsp";from=(49,2);to=(51,0)]
while(rs.next()){
// end
// HTML // begin [file="/show.jsp";from=(51,2);to=(56,0)]
out.write("\r\n <table width=\"100%\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tr>\r\n <td width=\"z5%\" align=\"center\">\r\n 留言人IP:\r\n");
// end
// begin [file="/show.jsp";from=(56,3);to=(56,21)]
out.print(rs.getString("ip"));
// end
// HTML // begin [file="/show.jsp";from=(56,23);to=(60,0)]
out.write("\r\n </td>\r\n<td width=\"z5%\" align=\"center\">\r\n 留言人:\r\n");
// end
// begin [file="/show.jsp";from=(60,3);to=(60,23)]
out.print(rs.getString("name"));
// end
// HTML // begin [file="/show.jsp";from=(60,25);to=(64,0)]
out.write("\r\n </td>\r\n<td width=\"z5%\" align=\"center\">\r\n 留言时间:\r\n");
// end
// begin [file="/show.jsp";from=(64,3);to=(64,23)]
out.print(rs.getString("time"));
// end
// HTML // begin [file="/show.jsp";from=(64,25);to=(70,0)]
out.write("\r\n </td>\r\n <td width=\"z5%\" align=\"center\">\r\n\r\n\r\n 留言人email:\r\n");
// end
// begin [file="/show.jsp";from=(70,3);to=(70,24)]
out.print(rs.getString("email"));
// end
// HTML // begin [file="/show.jsp";from=(70,26);to=(77,0)]
out.write("\r\n </td>\r\n </tr>\r\n <br>\r\n <tr>\r\n <td colspan=\"3\">\r\n <div align=\"left\"> 留言人内容:\r\n");
// end
// begin [file="/show.jsp";from=(77,3);to=(77,26)]
out.print(rs.getString("content"));
// end
// HTML // begin [file="/show.jsp";from=(77,28);to=(82,8)]
out.write(" </div>\r\n </td>\r\n\r\n </tr>\r\n </table>\r\n ");
// end
// begin [file="/show.jsp";from=(82,10);to=(93,12)]
}
try {
rs.close();
stmt.close();
dbManage.releaseConnection("access",con);
}
catch (Exception ex) {
ex.printStackTrace();
}
// end
// HTML // begin [file="/show.jsp";from=(93,14);to=(96,0)]
out.write("\r\n\r\n</body></html>\r\n");
// end
} catch (Throwable t) {
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (pageContext != null) pageContext.handlePageException(t);
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -