📄 buildhtmll.jsp
字号:
<%@ page contentType="text/html; charset=gb2312" import="java.util.*,java.io.*,java.sql.*"%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
String check = new String(request.getParameter("check").getBytes("ISO-8859-1"),"GBK");
String idsr = request.getParameter("idsr");
String title = new String(request.getParameter("bt").getBytes("ISO-8859-1"),"GBK");
String str = new String(request.getParameter("nr").getBytes("ISO-8859-1"),"GBK");
str=str.replaceAll("<","<");
String content = str.replaceAll("\r\n","<br>");
%>
<jsp:useBean id="ConBean" scope="session" class="com.bitc.ch13.DBCon"/>
<%
//更新数据库
Connection con = ConBean.getConnection();
String sql="update jsp8_news set lishu=?,biaoti=?,neirong=? where id='"+idsr+"'";
PreparedStatement pstmt = con.prepareStatement(sql);
pstmt.setString(1,check);
pstmt.setString(2,title);
pstmt.setString(3,content);
pstmt.executeUpdate();
pstmt.close();
ConBean.close();
%>
<script language="vbscript">
msgbox "发布成功!!",vbInformation,"提示"
window.location="wenzhangxp.jsp?id=<%=check%>"
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -