資源簡介
基于BootStrap3的javaee blog mvc版 博客開發,帶數據庫,tomcat7.0,jdk1.8,mysql可運行,eclipse項目

代碼片段和文件信息
package?cap.action;
import?java.io.IOException;
import?java.util.List;
import?javax.servlet.ServletException;
import?javax.servlet.annotation.WebServlet;
import?javax.servlet.http.HttpServlet;
import?javax.servlet.http.HttpServletRequest;
import?javax.servlet.http.HttpServletResponse;
import?javax.servlet.http.HttpSession;
import?cap.bean.Admin;
import?cap.bean.Article;
import?cap.bean.Comment;
import?cap.bean.Counter;
import?cap.bean.Profile;
import?cap.bean.SysCategory;
import?cap.bean.User;
import?cap.service.AdminService;
import?cap.service.ArticleService;
import?cap.service.CommentService;
import?cap.service.CounterService;
import?cap.service.ProfileService;
import?cap.service.SysCategoryService;
import?cap.service.UserService;
import?cap.service.impl.AdminServiceImpl;
import?cap.service.impl.ArticleServiceImpl;
import?cap.service.impl.CommentServiceImpl;
import?cap.service.impl.CounterServiceImpl;
import?cap.service.impl.ProfileServiceImpl;
import?cap.service.impl.SysCategoryServiceImpl;
import?cap.service.impl.UserServiceImpl;
import?cap.util.PageControl;
@WebServlet(“/admin.html“)
public?class?AdminServlet?extends?HttpServlet?{
private?static?final?long?serialVersionUID?=?1L;
private?AdminService?adminService;
private?UserService?userService;
private?ProfileService?profileService;
private?ArticleService?artService;
private?SysCategoryService?scService;
private?CounterService?cntService;
private?CommentService?cmtService;
???????
????
????public?AdminServlet()?{
???? adminService=new?AdminServiceImpl();
???? userService=new?UserServiceImpl();
???? profileService=new?ProfileServiceImpl();
???? artService=new?ArticleServiceImpl();
???? scService=new?SysCategoryServiceImpl();
???? cntService=new?CounterServiceImpl();
???? cmtService=new?CommentServiceImpl();
????}
protected?void?doGet(HttpServletRequest?request?HttpServletResponse?response)?throws?ServletException?IOException?{
this.doPost(request?response);
}
protected?void?doPost(HttpServletRequest?request?HttpServletResponse?response)?throws?ServletException?IOException?{
response.setContentType(“text/html“);
request.setCharacterEncoding(“UTF-8“);
String?action=request.getParameter(“action“);
if(action.equals(“login“)){
String?userName?=?request.getParameter(“username“);
String?passWord?=?request.getParameter(“password“);
Admin?admin?=?adminService.login(userName?passWord);
if?(admin?==?null)?{
request.getSession().setAttribute(“msg“?“用戶名或密碼不正確!“);
response.sendRedirect(“AdminLogin.jsp“);
}?else?{
request.getSession().setAttribute(“admin“?admin);
response.sendRedirect(“admin.html?action=index“);
}
}else?if(action.equals(“logout“)){
HttpSession?session?=?request.getSession(false);????//防止創建Session
if?(null?!=?session)?{
session.removeAttribute(“admin“);
}
request.getSession().setAttribute(“logoutMs
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-12-26?22:05??blog\
?????文件?????????539??2014-12-09?10:38??blog\.classpath
?????文件????????1037??2014-05-14?21:42??blog\.project
?????目錄???????????0??2017-12-26?22:05??blog\.settings\
?????文件?????????503??2014-05-14?21:42??blog\.settings\.jsdtscope
?????文件??????????48??2014-05-15?11:30??blog\.settings\org.eclipse.core.runtime.prefs
?????文件?????????598??2014-12-09?10:47??blog\.settings\org.eclipse.jdt.core.prefs
?????文件?????????464??2014-05-14?21:42??blog\.settings\org.eclipse.wst.common.component
?????文件?????????345??2014-09-15?21:33??blog\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件??????????49??2014-05-14?21:42??blog\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2014-05-14?21:42??blog\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2017-12-26?22:05??blog\WebContent\
?????文件????????6658??2014-09-16?16:15??blog\WebContent\AddArtical.jsp
?????文件????????4673??2014-09-16?15:29??blog\WebContent\AddCategory.jsp
?????文件????????3165??2014-09-16?15:29??blog\WebContent\AdminLogin.jsp
?????文件????????4662??2014-09-16?16:19??blog\WebContent\ApplyBlog.jsp
?????文件????????6783??2014-09-16?16:16??blog\WebContent\ArticleManage.jsp
?????文件????????5836??2014-09-16?15:30??blog\WebContent\BlogInfo.jsp
?????文件????????7609??2014-09-16?16:20??blog\WebContent\CategoryManage.jsp
?????文件????????6129??2014-09-16?15:30??blog\WebContent\CommentManage.jsp
?????文件????????4792??2014-09-16?15:30??blog\WebContent\EditCategory.jsp
?????文件????????2927??2015-06-25?16:55??blog\WebContent\Login.jsp
?????目錄???????????0??2017-12-26?22:05??blog\WebContent\me
?????文件??????????36??2014-05-14?21:46??blog\WebContent\me
?????文件?????????381??2015-06-25?17:19??blog\WebContent\me
?????文件????????7707??2014-09-16?15:30??blog\WebContent\MyBlogIndex.jsp
?????文件????????7597??2014-09-16?15:31??blog\WebContent\Post.jsp
?????文件???????10092??2014-09-16?15:31??blog\WebContent\Profile.jsp
?????文件????????3939??2014-09-16?15:31??blog\WebContent\Register.jsp
?????文件????????4658??2014-09-16?16:19??blog\WebContent\SearchResult.jsp
?????文件????????8800??2014-09-16?15:31??blog\WebContent\UpdateArtical.jsp
............此處省略181個文件信息
評論
共有 條評論