insertnews.jsp

来自「基于j2ee的物流软件」· JSP 代码 · 共 106 行

JSP
106
字号
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'insertNews.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link rel="stylesheet" type="text/css" href="employee/css/style.css">
		<link rel="stylesheet" type="text/css" href="employee/css/css.css">

  <script language="JavaScript">
function ValidateLoginForm(form)
{
      if (form.newsTitle.value == "")
   {
      alert("请输入新闻标题");
      return false
   }
      if (form.newsContent.value == "")
   {
      alert("请输入新闻内容");
      return false
   }
  
   return true  
}
 </script>

	</head>

	<body topMargin=0 leftmargin="0" marginheight="0">
		<form action="newsupservlet.do" method="post"  onSubmit="return ValidateLoginForm(this)" enctype="multipart/form-data">
			<table border=1 width="60%" cellspacing=1 cellpadding=3 align=center
				bordercolor="#326598">
				<tr bgcolor="#e8f4ff">
					<td height=25 colspan="2" background="admin/images/tile_sub.gif">
						新闻信息-&gt;增加一条新闻
					</td>
				</tr>
				<tr>
					<td>
						新闻标题
					</td>
					<td>
						<input type="text" name="newsTitle" size="15">
					</td>
				</tr>
				<tr>
					<td>
						新闻内容
					</td>
					<td>
						<textarea name="newsContent" cols="60" rows="6"></textarea>
					</td>
				</tr>
				<tr>
					<td>
						新闻作者
					</td>
					<td>
					    <input type="hidden" name="newsAuthor" value="${sessionScope.admin.loginId}">
						${sessionScope.admin.loginId}
					</td>
				</tr>
				<tr>
					<td>
						新闻图片
					</td>
					<td>
					    <input type="file" id="img" name="img"/>
					</td>
				</tr>
				<tr>
					<td>
						新闻描述
					</td>
					<td>
						<input type="text" name="newsRemark" size="40">
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						<input type="submit" value=" 提  交 " name="sub">
						<input type="button" value=" 查  看 " name="butt"
							onClick="javascript:window.location.href='http://localhost:8080/wuliu/newsShow.do?page=0'">
					</td>
				</tr>
			</table>
		</form>
	</body>
</html>

⌨️ 快捷键说明

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