📄 note4_0002ejsp_jsp.java
字号:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.*;
public class note4_0002ejsp_jsp extends HttpJspBase {
static {
}
public note4_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=GBK");
pageContext = _jspxFactory.getPageContext(this, request, response,
"", true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
// HTML // begin [file="/note4.jsp";from=(0,48);to=(1,0)]
out.write("\r\n");
// end
// HTML // begin [file="/note4.jsp";from=(1,30);to=(24,0)]
out.write("\r\n<style type=\"text/css\">\r\n<!--\r\nbody {\r\n\tbackground-color: #99CCFF;\r\n}\r\n-->\r\n</style>\r\n<style type=\"text/css\">\r\n <!--\r\n a:link { text-decoration: none;color: #FF6600}\r\n a:active { text-decoration:blink}\r\n a:hover { text-decoration:underline;color: red}\r\n a:visited { text-decoration: none;color: green}\r\n -->\r\n </style>\r\n<html>\r\n<head>\r\n<title>\r\n好友信息\r\n</title>\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n");
// end
// begin [file="/note4.jsp";from=(24,2);to=(27,1)]
String name=(String)session.getAttribute("strname");
if(name==null||name=="")
{
// end
// HTML // begin [file="/note4.jsp";from=(27,3);to=(30,0)]
out.write("\r\n<p>没有该好友!</p>\r\n<p><a href=\"booknote.html\">回上一页</a>\r\n");
// end
// begin [file="/note4.jsp";from=(30,2);to=(30,8)]
}else{
// end
// HTML // begin [file="/note4.jsp";from=(30,10);to=(35,6)]
out.write("\r\n</p>\r\n<form action=\"note3.jsp\" method=\"post\">\r\n <div align=\"center\">\r\n <p>\r\n ");
// end
// begin [file="/note4.jsp";from=(35,8);to=(48,0)]
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String driver = "jdbc:odbc:shm";
Connection conn = DriverManager.getConnection(driver,"sa","");
Statement stmt = conn.createStatement();
//生成查询的sql命令
String sql="select * from booknote where name='"+name+"'";
//rs为返回结果的ResultSet对象
ResultSet rs=stmt.executeQuery(sql);
rs.next();
String tel=rs.getString("tel").trim();
String email=rs.getString("email").trim();
String address=rs.getString("address").trim();
// end
// HTML // begin [file="/note4.jsp";from=(48,2);to=(54,25)]
out.write("\r\n 请按照下表修改好友的信息!</p>\r\n <hr />\r\n <table width=\"527\" border=\"0\">\r\n <tr>\r\n <td width=\"153\" height=\"32\">好友Name: </td>\r\n <td width=\"364\" >");
// end
// begin [file="/note4.jsp";from=(54,28);to=(54,32)]
out.print(name);
// end
// HTML // begin [file="/note4.jsp";from=(54,34);to=(55,42)]
out.write(" </td>\r\n\t\t<input type=\"hidden\" name=\"name\" value=\"");
// end
// begin [file="/note4.jsp";from=(55,45);to=(55,49)]
out.print(name);
// end
// HTML // begin [file="/note4.jsp";from=(55,51);to=(59,50)]
out.write("\">\r\n </tr>\r\n <tr>\r\n <td height=\"29\">好友Tel:</td>\r\n <td><input type=\"text\" name=\"tel\" value=\"");
// end
// begin [file="/note4.jsp";from=(59,53);to=(59,56)]
out.print(tel);
// end
// HTML // begin [file="/note4.jsp";from=(59,58);to=(63,52)]
out.write("\"/></td>\r\n </tr>\r\n <tr>\r\n <td height=\"34\">好友E-mail:</td>\r\n <td><input type=\"text\" name=\"email\" value=\"");
// end
// begin [file="/note4.jsp";from=(63,55);to=(63,60)]
out.print(email);
// end
// HTML // begin [file="/note4.jsp";from=(63,62);to=(67,54)]
out.write("\"/></td>\r\n </tr>\r\n <tr>\r\n <td height=\"27\">好友Address:</td>\r\n <td><input type=\"text\" name=\"address\" value=\"");
// end
// begin [file="/note4.jsp";from=(67,57);to=(67,64)]
out.print(address);
// end
// HTML // begin [file="/note4.jsp";from=(67,66);to=(81,0)]
out.write("\"/></td>\r\n </tr>\r\n </table>\r\n <hr />\r\n <table width=\"320\" border=\"0\">\r\n <tr>\r\n <td height=\"31\"><input type=\"submit\" name=\"Submit\" value=\"确认\" /></td>\r\n <td><input type=\"reset\" name=\"Submit2\" value=\"清除\" /></td>\r\n </tr>\r\n </table>\r\n <p> </p>\r\n <p> </p>\r\n </div>\r\n</form>\r\n");
// end
// begin [file="/note4.jsp";from=(81,2);to=(81,3)]
}
// end
// HTML // begin [file="/note4.jsp";from=(81,5);to=(84,0)]
out.write("\r\n</body>\r\n</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 + -