📄 savenews.jsp
字号:
<%@ page contentType="text/html;charset=gb2312" %>
<%@ include file="../inc/incdb.jsp"%>
<%@ include file="session.jsp"%>
<%try{
String subject = new String(request.getParameter("subject").getBytes("ISO8859_1"),"GBK");
String content = new String(request.getParameter("Content").getBytes("ISO8859_1"),"GBK");
String pic = request.getParameter("pic");
int rootid = Integer.parseInt(request.getParameter("classid"));
String master = (String) session.getValue("userName_s");
NewsControl newscontrol= new NewsControl();
newscontrol.setTopic(subject);
newscontrol.setBody(CodeFilter.toHtml(content));
newscontrol.setAdddate(GetDate.getStringDate());
newscontrol.setAdduser(master);
newscontrol.setRootID(rootid);
newscontrol.setPic(pic);
int newsid = newscontrol.insertnews();
//发表后,该用户发表数+1
MasterControl mastercontrol = new MasterControl();
mastercontrol.setUserName(master);
mastercontrol.addnewsnum();%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<meta HTTP-EQUIV=REFRESH CONTENT='4; URL=../news.jsp?id=<%=newsid%>'>
<title>欢迎光临<%=title%></title>
<link rel="stylesheet" href="../css/news.css" type="text/css" media="screen">
</head>
<body>
<TABLE bgColor=<%=tablebgcolor%> border=0 cellPadding=0 cellSpacing=1 width=400 align=CENTER>
<TR>
<TD align=middle background=../img/index/topback.gif height=10></TD>
</TR>
</TABLE>
<TABLE border="0" width=400 align=center cellpadding=0 cellspacing=1 bgcolor=<%=tablebgcolor%>>
<TR bgcolor=<%=trbgcolor%> height=25><TD align=center><FONT COLOR=red><B>新闻发布成功</B></FONT></TD>
</TR>
<TR><TD align=center bgColor=<%=tdbgcolor%>><BR>本页面将在<b><span id=yu>3</span><a href=javascript:countDown></a></b>秒后自动返回您所发布的新闻页面,您可以选择以下操作:<BR><BR>
<li><a href="../index.jsp">返回首页</a></li><br>
<li><a href='addnews.jsp'>继续发布新闻</a></li><br>
<li><a href="../news.jsp?id=<%=newsid%>">发布的新闻</a></li><br>
<li><a href="main.jsp">返回管理页面</a></li>
</TD></TR>
</TABLE>
<%@ include file="../inc/tail.jsp"%>
<script>
function
countDown(secs){yu.innerText=secs;if(--secs>0)setTimeout("countDown("+secs+")",1000);}countDown(3);
</script>
<%
}
catch(Exception e){
out.println("错误信息:"+e.getMessage());
}%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -