資源簡介
struts2+spring+hibernate三大框架,附數據庫,實現教務信息管理。
代碼片段和文件信息
package?com.sl.action;
import?javax.annotation.Resource;
import?org.springframework.context.annotation.Scope;
import?org.springframework.stereotype.Controller;
import?com.opensymphony.xwork2.ActionContext;
import?com.opensymphony.xwork2.ActionSupport;
import?com.sl.dao.AdminDao;
import?com.sl.dao.impl.AdminDaoImpl;
import?com.sl.entity.Admin;
@Controller?@Scope(“prototype“)
public?class?ChangePwdAction?extends?ActionSupport{
private?String?oldPassword;
private?String?newPassword;
private?String?newPassword2;
@Resource?AdminDao?adminDao=new?AdminDaoImpl();?
public?String?getOldPassword()?{
return?oldPassword;
}
public?void?setOldPassword(String?oldPassword)?{
this.oldPassword?=?oldPassword;
}
public?String?getNewPassword()?{
return?newPassword;
}
public?void?setNewPassword(String?newPassword)?{
this.newPassword?=?newPassword;
}
public?String?getNewPassword2()?{
return?newPassword2;
}
public?void?setNewPassword2(String?newPassword2)?{
this.newPassword2?=?newPassword2;
}
/*修改密碼*/
public?String?execute()?{
ActionContext?ctx?=?ActionContext.getContext();?
if(oldPassword.equals(““))?{
ctx.put(“error“??java.net.URLEncoder.encode(“請輸入舊密碼!“));
return?“error“;
}
if(newPassword.equals(““))?{
ctx.put(“error“??java.net.URLEncoder.encode(“請輸入新密碼!“));
return?“error“;
}
if(!newPassword2.equals(newPassword))?{
ctx.put(“error“??java.net.URLEncoder.encode(“兩次密碼輸入不一致!“));
return?“error“;
}
String?username?=?(String)ctx.getSession().get(“username“);?
Admin?admin?=?adminDao.GetAdmin(username);?
if(!admin.getPassword().equals(oldPassword))?{
ctx.put(“error“??java.net.URLEncoder.encode(“舊密碼不正確!“));
return?“error“;
}
try?{?
adminDao.ChangePassword(usernamenewPassword);
ctx.put(“message“??java.net.URLEncoder.encode(“密碼修改成功!“));
return?“change_success“;
}?catch?(Exception?e)?{
e.printStackTrace();
ctx.put(“error“??java.net.URLEncoder.encode(“密碼更新失敗!“));
return?“error“;
}??
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5646??2017-06-18?15:23??ssh1\manage.sql
?????文件????????529??2017-06-18?15:23??ssh1\ManageSystem\.classpath
?????文件????????510??2017-06-18?15:23??ssh1\ManageSystem\.myhibernatedata
?????文件????????309??2017-06-18?15:23??ssh1\ManageSystem\.myme
?????文件????????240??2017-06-18?15:23??ssh1\ManageSystem\.mystrutsdata
?????文件???????2040??2017-06-18?15:23??ssh1\ManageSystem\.project
?????文件????????500??2017-06-18?15:23??ssh1\ManageSystem\.settings\.jsdtscope
?????文件????????132??2017-06-18?15:23??ssh1\ManageSystem\.settings\org.eclipse.core.resources.prefs
?????文件????????364??2017-06-18?15:23??ssh1\ManageSystem\.settings\org.eclipse.jdt.core.prefs
?????文件????????474??2017-06-18?15:23??ssh1\ManageSystem\.settings\org.eclipse.wst.common.component
?????文件????????252??2017-06-18?15:23??ssh1\ManageSystem\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2017-06-18?15:23??ssh1\ManageSystem\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2017-06-18?15:23??ssh1\ManageSystem\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件???????3074??2017-06-18?15:23??ssh1\ManageSystem\src\applicationContext.xm
?????文件???????2190??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\action\ChangePwdAction.java
?????文件???????5988??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\action\ClassAction.java
?????文件???????1037??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\action\LoginAction.java
?????文件??????10566??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\action\StudentAction.java
?????文件??????10269??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\action\TeacherAction.java
?????文件????????258??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\action\UserAction.java
?????文件????????272??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\dao\AdminDao.java
?????文件????????859??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\dao\ClassesDao.java
?????文件???????1606??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\dao\impl\AdminDaoImpl.java
?????文件???????4451??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\dao\impl\ClassesDaoImpl.java
?????文件???????5480??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\dao\impl\StudentDaoImpl.java
?????文件???????4826??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\dao\impl\TeacherDaoImpl.java
?????文件???????1038??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\dao\StudentDao.java
?????文件????????934??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\dao\TeacherDao.java
?????文件????????685??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\entity\Admin.hbm.xm
?????文件????????595??2017-06-18?15:23??ssh1\ManageSystem\src\com\sl\entity\Admin.java
............此處省略211個文件信息
- 上一篇:應用多元統計分析 高惠璇
- 下一篇:微信h5游戲 奪寶源碼
評論
共有 條評論