`
文章列表
boolean autoCommit = conn.getAutoCommit();//手动提交事务,保证数据库数据的一致性。 conn.setAutoCommit(false); int rootid = -1; String sql = "insert into article values(null, ?, ?, ?, ?, now(), ?)"; PreparedStatement pstmt = DB.getPstmt(conn, sql, Statement.RETURN_GENERATED_KEYS); pstmt.setIn ...
javaScript页面跳转的效果: <span id="time" style="background:red">5</span>秒钟后,页面会自动跳转,如果不跳转请单击下面的链接<a href="article.jsp">回到主页</a> <script language="JavaScript1.2" type="text/javascript"> function delayURL(url) { v ...
1、关于递归方法的使用(2个): (1)用递归展现树状的帖子,代码如下: public void tree(List<Article> articles, Connection conn, int id, int grade) { String sql = "select * from article where pid = " + id; Statement stmt = DB.createStmt(conn); ResultSet rs = DB.executeQuery(stmt, sql); try { whi ...
1、Jsp页面上显示乱码: 解决:在Jsp页面加上头信息<%@ pageEncoding="utf-8" %> 2、调用servlet时候的乱码: 解决:response.ContentType("text/html"); 3、在Jsp页面通过action向Servlet提交参数servlet接受的参数为乱码: 解决:request.setCharacterEncoding("utf-8"); (更好的解决办法:使用过滤器) 4、在Jsp的页面中通过超链 ...
//页面置顶显示 if(window.self != window.top) { window.top.location = window.self.location; } //刷新上层页面 window.parent.main.document.location.reload(); //显示div function fnBlock(){ document.getElementById("showMsg").style.display="block"; } //隐藏div func ...
Global site tag (gtag.js) - Google Analytics