📄 changemypwdaction.java
字号:
package com.cmmi2pms.sa.user;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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.apache.log4j.Logger;
import com.cmmi2pms.common.Constants;
public class ChangeMyPwdAction extends Action {
// --------------------------------------------------------- Instance Variables
// --------------------------------------------------------- Methods
private static Logger logger = Logger.getLogger ("AlterUserAction") ;
/**
* Method execute
* @param ActionMapping mapping
* @param ActionForm form
* @param HttpServletRequest request
* @param HttpServletResponse response
* @return ActionForward
* @throws Exception
*/
public ActionForward perform(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {
Employee theEmployee = new Employee();
User theUser = new User();
int userid =0;
try{
theEmployee = (Employee) request.getSession().getAttribute(Constants.USER_KEY);
Integer id = new Integer(theEmployee.getUserID());
userid = id.intValue();
}
catch (Exception e){
logger.error("Exception is throwed from getProjectID:"+e.getMessage());
}
logger.info("修改用户自己密码:" + userid + "is caled");
UserForm theUserForm = (UserForm) form;
theUser.getUserInfor(userid);
theUserForm.setUserID(userid);
theUserForm.setUsername(theUser.getUsername());
theUserForm.setPassword(theUser.getPassword());
//theUser.updateUser(theUserForm);
return (mapping.findForward("SUCCESS"));
//throw new UnsupportedOperationException("Generated method 'execute(...)' not implemented.");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -