⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 insertnews.jsp

📁 新闻网(news) 带使用说明书 可以用作课程设计
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page import="java.util.List"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.victor.domain.NewsStyleActionForm"%>
<%@ page import="com.victor.tool.Chinese"%>
<html>
<head>
<title>添加新闻</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
}
td{
font-size:9pt;
}
.style1 {
	color: #FF9900;
	font-weight: bold;
}
-->
</style></head>
<script language="JavaScript">
function RgTest(){
if(document.form.newTitle.value==""){
window.alert("请输入新闻标题:");
document.form.newTitle.focus();
return false;
}

if(document.form.newContent.value==""){
window.alert("请输入新闻内容:");
document.form.newContent.focus();
return false;
}

if(document.form.newsStyle.value==""){
window.alert("请选择新闻类型:");
document.form.newsStyle.focus();
return false;
}
return true;
}
</script>

<body>
<table width="568" height="419"  border="0" cellpadding="2" cellspacing="1" bgcolor="#052754">
  <tr>
    <td align="center" valign="top" bgcolor="#FFFFFF">
	 <p class="style1"><br>
	   <br>
	   <br>
      添加新闻</p>
  <form name="form" method="post" action="insertNewsAction.do" onSubmit="return RgTest()">
&nbsp;&nbsp;&nbsp;    <table width="454" border="0" cellpadding="2" cellspacing="1" bgcolor="#052754">
      <tr>
        <td width="84"  height="24"align="center" bgcolor="#0099cc">新闻标题</td>
        <td width="303" bgcolor="#ffffff"><input name="newTitle" type="text" size="30"></td>
      </tr>

      <tr>
        <td height="85" align="center" bgcolor="#0099cc">新闻内容</td>
        <td bgcolor="#ffffff"><textarea name="newContent" cols="50" rows="12"></textarea></td>
      </tr>
	  <tr>
        <td width="84"  height="24"align="center" bgcolor="#0099cc">类型</td>
<%Chinese chinese=new Chinese();%>
        <td width="303" bgcolor="#ffffff"><input name="newsType" type="hidden" value="<%=chinese.str(request.getParameter("type"))%>"><%=chinese.str(request.getParameter("type"))%></td>
      </tr>

	  <tr>
        <td align="center" height="24" bgcolor="#0099cc">详细类别</td>
        <td bgcolor="#ffffff"><select name="newsStyle">
		<option value="">请选择</option>
<%List listStyle=(List)request.getAttribute("listStyle");%>
<%for(int i=0;i<listStyle.size();i++){
NewsStyleActionForm style=(NewsStyleActionForm)listStyle.get(i);
%>
<option value="<%=style.getStyleName()%>"><%=style.getStyleName()%></option>
<%}%>
        </select>		</td>
      </tr>

    </table>
  <br>
  <input type="submit" name="Submit2" value="提交">
  &nbsp;&nbsp;&nbsp;&nbsp;
  <input type="reset" name="Submit" value="重置">
  </form>	</td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -