📄 modify1_0002ejsp_jsp.java
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class modify1_0002ejsp_jsp extends HttpJspBase {
// begin [file="/modify1.jsp";from=(6,0);to=(6,86)]
// end
static {
}
public modify1_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="/modify1.jsp";from=(0,0);to=(4,0)]
out.write("<html>\r\n<head>\r\n<title>修改用户信息</title>\r\n</head>\r\n");
// end
// HTML // begin [file="/modify1.jsp";from=(4,50);to=(5,0)]
out.write("\r\n");
// end
// HTML // begin [file="/modify1.jsp";from=(5,31);to=(6,0)]
out.write("\r\n");
// end
// begin [file="/modify1.jsp";from=(6,0);to=(6,86)]
com.test.DB.DBConnManager connManager = null;
boolean _jspx_specialconnManager = false;
synchronized (application) {
connManager= (com.test.DB.DBConnManager)
pageContext.getAttribute("connManager",PageContext.APPLICATION_SCOPE);
if ( connManager == null ) {
_jspx_specialconnManager = true;
try {
connManager = (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("connManager", connManager, PageContext.APPLICATION_SCOPE);
}
}
if(_jspx_specialconnManager == true) {
// end
// begin [file="/modify1.jsp";from=(6,0);to=(6,86)]
}
// end
// HTML // begin [file="/modify1.jsp";from=(6,86);to=(11,0)]
out.write("\r\n<body bgcolor=\"#CFF1E1\">\r\n<center>\r\n<h3>该用户信息如下:</h3>\r\n</center>\r\n");
// end
// begin [file="/modify1.jsp";from=(11,2);to=(19,0)]
int id=0;
try{
id=Integer.parseInt(request.getParameter("id").toString());
}catch(Exception e){
out.println("链接错误");
out.close();
}
// end
// HTML // begin [file="/modify1.jsp";from=(19,2);to=(20,0)]
out.write("\r\n");
// end
// begin [file="/modify1.jsp";from=(20,2);to=(24,0)]
Connection con = connManager.getConnection("access");
if(con==null)
{
// end
// HTML // begin [file="/modify1.jsp";from=(24,2);to=(25,0)]
out.write("对不起,现在数据库忙,请稍后再试\r\n");
// end
// begin [file="/modify1.jsp";from=(25,2);to=(31,0)]
}
Statement stmt = con.createStatement();
ResultSet rs=stmt.executeQuery("select * from Users where ID="+id);
if(rs.next())
{
// end
// HTML // begin [file="/modify1.jsp";from=(31,2);to=(34,37)]
out.write("\r\n<center>\r\n<form action=\"modify2.jsp\" method=\"post\">\r\n<input type=\"hidden\" name=\"id\" value=");
// end
// begin [file="/modify1.jsp";from=(34,40);to=(34,55)]
out.print(rs.getInt("ID"));
// end
// HTML // begin [file="/modify1.jsp";from=(34,57);to=(38,29)]
out.write(">\r\n<table border=1>\r\n<tr>\r\n<td>用户名</td>\r\n<td><input name=userid value=");
// end
// begin [file="/modify1.jsp";from=(38,32);to=(38,54)]
out.print(rs.getString("UserID"));
// end
// HTML // begin [file="/modify1.jsp";from=(38,56);to=(42,27)]
out.write("></td>\r\n</tr>\r\n<tr>\r\n<td>姓名</td>\r\n<td><input name=name value=");
// end
// begin [file="/modify1.jsp";from=(42,30);to=(42,50)]
out.print(rs.getString("Name"));
// end
// HTML // begin [file="/modify1.jsp";from=(42,52);to=(46,28)]
out.write("></td>\r\n</tr>\r\n<tr>\r\n<td>电子邮件</td>\r\n<td><input name=email value=");
// end
// begin [file="/modify1.jsp";from=(46,31);to=(46,52)]
out.print(rs.getString("Email"));
// end
// HTML // begin [file="/modify1.jsp";from=(46,54);to=(55,0)]
out.write("></td>\r\n</tr>\r\n\r\n</table>\r\n<p></p>\r\n<input type=\"submit\" value=\"提交\">\r\n<input type=\"reset\" value=\"重置\">\r\n</form>\r\n<center>\r\n");
// end
// begin [file="/modify1.jsp";from=(55,2);to=(63,0)]
}else
{
out.println("链接错误!<a href='userManage.jsp'>请返回</a>");
}
rs.close();
stmt.close();
connManager.releaseConnection("access",con);
// end
// HTML // begin [file="/modify1.jsp";from=(63,2);to=(67,0)]
out.write("\r\n</body>\r\n</html>\r\n\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 + -