⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 saveeditpwdaction.java

📁 该系统采用了B/S结构模式
💻 JAVA
字号:
package org.mmxbb.exam.business.exam;

import java.sql.SQLException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.mmxbb.exam.business.LogonBean;
import org.mmxbb.exam.dao.ExamineeDAO;



public class SaveEditPwdAction
    extends Action {
  public ActionForward execute(ActionMapping actionMapping,
                               ActionForm actionForm,
                               HttpServletRequest httpServletRequest,
                               HttpServletResponse httpServletResponse) {
    ExamineeDAO eDAO = null;
    String logon = null;
    String passwordOld = null;
    String passwordNew = null;
    String passwordNew2 = null;
    String passwordPre = null;

    LogonBean logonBean = new LogonBean();
    passwordOld = httpServletRequest.getParameter("passwordOld");
    passwordNew = httpServletRequest.getParameter("passwordNew");
    passwordNew2 = httpServletRequest.getParameter("passwordNew2");
    passwordPre = httpServletRequest.getParameter("httpServletRequest");

    HttpSession session = httpServletRequest.getSession();
    if ( (session != null) && (session.getAttribute("logon") != null)) {
      logonBean = (LogonBean) session.getAttribute("logon");
      logon = logonBean.getLogon();
      if (passwordNew.equals(passwordNew2)) {
        eDAO = new ExamineeDAO();
        try {
          eDAO.updatePwd(logon, passwordOld, passwordNew);
        } catch (SQLException ex) {
          return actionMapping.findForward("error");
        }
      }
    } else {
      return actionMapping.findForward("logon");
    }
    return actionMapping.findForward("sucesssaveexamineepwd");
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -