PwdChangeAction.java~10~
上传用户:dlqqsh
上传日期:2021-11-13
资源大小:7840k
文件大小:2k
源码类别:

OA系统

开发平台:

Java

  1. package officeol.mc.actions;
  2. import org.apache.struts.action.ActionMapping;
  3. import org.apache.struts.action.ActionForm;
  4. import javax.servlet.http.HttpServletRequest;
  5. import javax.servlet.http.HttpServletResponse;
  6. import org.apache.struts.action.ActionForward;
  7. import org.apache.struts.action.Action;
  8. import officeol.mc.tools.*;
  9. public class PwdChangeAction extends Action {
  10.     public ActionForward execute(ActionMapping mapping, ActionForm form,
  11.                                  HttpServletRequest request,
  12.                                  HttpServletResponse response) {
  13.         try{
  14.             request.setCharacterEncoding("GBK");
  15.             String un = request.getParameter("un");
  16.             String pwd = request.getParameter("pwd");
  17.             String pwd1 = request.getParameter("pwd1");
  18.             String pwd2 = request.getParameter("pwd2");
  19.             DBConn dbc = new DBConn();
  20.             Tool tl = new Tool();
  21.             String csql = "";
  22.             if(un!=null){
  23.                 if(pwd!=null){
  24.                     if(pwd1!=null&&pwd2!=null){
  25.                     }else{
  26.                         request.setAttribute("msg","两次输入新密码都不能为空!");
  27.                     }
  28.                 }else{
  29.                     request.setAttribute("msg","原密码不能为空!");
  30.                 }
  31.             }else{
  32.                 request.setAttribute("msg","用户名不能为空!");
  33.             }
  34.             request.setAttribute("msg","修改成功!");
  35.         }catch(Exception ex){
  36.             ex.printStackTrace();
  37.             request.setAttribute("msg","出现异常,请重试!");
  38.         }
  39.         return mapping.findForward("succ");
  40.     }
  41. }