• 大小: 13.93MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-26
  • 语言: Java
  • 标签: Java  web  

资源简介

java web sql server 数据库

资源截图

代码片段和文件信息

package com.ambow.cms.controller;

import java.io.IOException;

import javax.jms.Session;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.ambow.cms.domain.Admin;
import com.ambow.cms.service.impl.AdminServiceImpl;
import com.ambow.cms.service.interf.AdminService;

public class AdminController extends HttpServlet {

/**
 * 
 */
private static final long serialVersionUID = 1L;
AdminService adminService=new AdminServiceImpl();

public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
request.setCharacterEncoding(“utf-8“);
String oper = request.getParameter(“oper“);
if (“updateadminpwd“.equals(oper)) {
updareAdminPwd(request response);
}else if (“outsystem“.equals(oper)) {
outSystem(requestresponse);
}

}

private void outSystem(HttpServletRequest request
HttpServletResponse response) throws IOException {
HttpSession  session=request.getSession();
session.removeAttribute(“admin“);
response.sendRedirect(“/my/backend/login.jsp“);

}

private void updareAdminPwd(HttpServletRequest request
HttpServletResponse response) throws ServletException IOException {
HttpSession session=request.getSession();
String oldpassword=request.getParameter(“oldpassword“);//旧密码
String newpassword1=request.getParameter(“newpassword1“);//新密码
String newpassword2=request.getParameter(“newpassword2“);//新密码确认

Admin admin=(Admin) session.getAttribute(“admin“);//获取session中的管理员信息
int id=admin.getId();
String olderpassword=admin.getPassword();//管理员的旧密码
String msg=““;

if(olderpassword.equals(oldpassword)){
if (newpassword1.equals(newpassword2)) {
Admin admin1=new Admin();
admin1.setId(id);
admin1.setPassword(newpassword1);
boolean result=adminService.updatePassword(admin1);
if (result) {
msg=“密码修改成功!“;
session.removeAttribute(“admin“);
session.setAttribute(“admin“ admin1);
request.setAttribute(“msg“ msg);
request.getRequestDispatcher(“/WEB-INF/showMsg.jsp“).forward(request response);
}else {
msg=“密码修改不成功!返回密码修改页面“;
request.setAttribute(“msg“ msg);
request.getRequestDispatcher(“/WEB-INF/showMsg.jsp“).forward(request response);
}
}else {
msg=“两次密码输入不一致,请重新输入!返回密码修改页面“;
request.setAttribute(“msg“ msg);
request.getRequestDispatcher(“/WEB-INF/showMsg.jsp“).forward(request response);
}
}else {
msg=“密码不正确,请重新输入!返回密码修改页面“;
request.setAttribute(“msg“ msg);
request.getRequestDispatcher(“/WEB-INF/showMsg.jsp“).forward(request response);
}
}

public void doPost

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        650  2012-10-14 18:44  CMS4.2.3\.classpath

     文件        292  2012-10-15 16:22  CMS4.2.3\.mymetadata

     文件       1751  2012-10-15 13:56  CMS4.2.3\.project

     文件        500  2012-10-14 18:44  CMS4.2.3\.settings\.jsdtscope

     文件        116  2012-10-14 18:44  CMS4.2.3\.settings\org.eclipse.core.resources.prefs

     文件        395  2012-10-14 18:44  CMS4.2.3\.settings\org.eclipse.jdt.core.prefs

     文件        522  2012-10-14 18:44  CMS4.2.3\.settings\org.eclipse.wst.common.component

     文件        252  2012-10-14 18:44  CMS4.2.3\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2012-10-14 18:44  CMS4.2.3\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2012-10-14 18:44  CMS4.2.3\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件     545479  2012-10-15 16:48  CMS4.2.3\SQL\cms.sql

     文件         84  2012-10-14 22:21  CMS4.2.3\SQL\说明

     文件       3240  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\AdminController.java

     文件       4331  2012-10-14 17:07  CMS4.2.3\src\com\ambow\cms\controller\AdminServlet.java

     文件       2934  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\ArticleCrulServlet.java

     文件      16867  2012-10-15 11:03  CMS4.2.3\src\com\ambow\cms\controller\ArticleServlet.java

     文件       2128  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\BackupServlet.java

     文件       8525  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\ChannelServlet.java

     文件       4088  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\CheckedCodeServlet.java

     文件       3342  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\CommentController.java

     文件       3780  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\commentServlet.java

     文件        994  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\CompetenceController.java

     文件       1034  2012-10-14 21:25  CMS4.2.3\src\com\ambow\cms\controller\exitServlet.java

     文件       4836  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\findPasswordServlet.java

     文件       3201  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\IndexServlet.java

     文件       4430  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\LoginServlet.java

     文件       6771  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\MemberController.java

     文件       3065  2012-10-14 21:10  CMS4.2.3\src\com\ambow\cms\controller\MemberdetailController.java

     文件      20728  2012-10-14 18:44  CMS4.2.3\src\com\ambow\cms\controller\MemberServeServlet.java

     文件       1046  2012-10-14 22:03  CMS4.2.3\src\com\ambow\cms\controller\OutServlet.java

............此处省略783个文件信息

评论

共有 条评论