新闻发布项目——后台JSP界面adminManage/addNews.jsp

<%@page import="bdqn.newsManageServlet.Service.Impl.categoryTBServiceImpl"%>
<%@page import="bdqn.newsManageServlet.Service.categoryTBService"%>
<%@page import="bdqn.newsManageServlet.entity.categoryTB"%>
<%@page import="bdqn.newsManageServlet.Dao.Impl.categoryTBDaoImpl"%>
<%@page import="bdqn.newsManageServlet.Dao.categoryTBDao"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../CSS/admin.css" rel="stylesheet" type="text/css" />
<title>添加新闻</title>
</head>
<%
	//获取下拉列表的值
	//在数据库中获取所有的类别名称
	categoryTBService cateService=new categoryTBServiceImpl();
	List<categoryTB>clist=new ArrayList<categoryTB>();
	clist=cateService.getCategoryTBAll();
%>
<body>
	<form action="../doNewsAddServlet" method="post"
		enctype="multipart/form-data">
		<div id="opt_type">添加新闻</div>
		主题<select name="slt" class="classlist">
			<%
				for (int i = 0; i < clist.size(); i++) {
			%>
			<option><%=clist.get(i).getCategoryName()%>
			</option>
			<%
				}
			%>
		</select><br /> 
		标题<input type="text" class="classlist" name="title" /><br />
		作者<input type="text" class="classlist" name="author" /><br />
		 摘要
		<textarea cols="30" rows="3" class="classlist" name="summary"></textarea>
		<br /> 
		内容
		<textarea cols="50" rows="6" class="classlist" name="content"></textarea>
		<br /> 
		上传图片<input type="file" class="classlist" name="picPath" />
		<span style="color:red"><%
 	String uMsg = (String) request.getAttribute("mesg");
 	if (uMsg == null) {
 		out.print(""); 
 	} else {
 		out.print(uMsg);
 	}
 	%></span>
		<input type="submit" value="提交" class="classlist" /> 
		<input
			type="reset" value="重置" class="classlist" />
	</form>
</body>
</html>

posted @ 2016-11-25 00:25  穆雄雄  阅读(302)  评论(0编辑  收藏  举报