java新闻项目Springmvc框架结合使用Word格式文档下载.docx
《java新闻项目Springmvc框架结合使用Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《java新闻项目Springmvc框架结合使用Word格式文档下载.docx(15页珍藏版)》请在冰豆网上搜索。
String,Object>
map){
SqlSessionssession=MyBatisTemple.getSession().openSession();
NewsViewDaonewview=ssession.getMapper(NewsViewDao.class);
List<
NewsViewEntity>
newss=newview.findAll();
map.put("
newss"
newss);
return"
admin/footPrint"
;
}
/adminDoBidden"
privateStringadminDoBidden(intid,intstatus){
AdminDaoadmins=ssession.getMapper(AdminDao.class);
admins.forbidden(status,id);
mit();
admin/index"
/adminDoEdit"
privateStringadminDoEdit(AdminEntityadminentity){
AdminEntityadmin=newAdminEntity(adminentity.getUsername(),
adminentity.getUpass(),adminentity.getName(),
adminentity.getStatus());
admin.setId(adminentity.getId());
admins.updateAdmin(admin);
redirect:
AdminList"
/adminToEdit"
privateStringadminToEdit(intid,Map<
AdminEntityadmin=admins.findIOne(id);
admin"
admin);
admin/editAdmin"
/adminDoAdd"
privateStringadminDoAdd(AdminEntityadminentity){
admins.addAdmin(admin);
/adminToAdd"
privateStringadminToAdd(){
admin/addAdmin"
/AdminList"
privateStringAdminList(Map<
AdminDaoadmin=ssession.getMapper(AdminDao.class);
AdminEntity>
admins=admin.findAll();
admins"
admins);
admin/listAdmin"
/NewsDoEdit"
privateStringNewsDoEdit(intid,Stringtitle,Stringauthor,
intpageview,Stringcontent1,intstatus){
NewsEntitynews=newNewsEntity(title,author,newDate(),pageview,
content1,status);
news.setId(id);
NewsDaonewss=ssession.getMapper(NewsDao.class);
newss.updateNews(news);
NewsList"
/NewsToEdit"
privateStringNewsToEdit(intid,Map<
NewsEntitynews=newss.findIOne(id);
news"
news);
admin/editNews"
/NewsDoAdd"
privateStringNewsDoAdd(Stringtitle,Stringauthor,Stringcontent1){
NewsEntitynewdao=newNewsEntity(title,author,newDate(),0,
content1,0);
newss.addNews(newdao);
/NewsToadd"
privateStringNewsToadd(){
admin/addNews"
/NewsList"
privateStringNewsList(Map<
NewsDaonews=ssession.getMapper(NewsDao.class);
NewsEntity>
newss=news.findAll();
admin/listNews"
/index"
privateStringindex(Stringusername,Stringupass){
System.out.println(username+upass);
AdminEntityadmin=admins.login(username,upass,0);
if(admin!
=null){
//System.out.println("
login����"
);
//HttpSessionsession=request.getSession();
//session.setAttribute("
AdminLOGIN"
��ת"
//response.sendRedirect("
index.admin"
return"
}else{
login.jsp"
admin/login"
}
/login"
privateStringlogin(){
//System.out.println(username+upass);
//SqlSessionssession=MyBatisTemple.getSession().openSession();
//AdminDaoadmins=ssession.getMapper(AdminDao.class);
//AdminEntityadmin=admins.login(username,upass,0);
//if(admin!
//System.out