资源简介
管理员账户123 密码123 使用Mysql 已解决中文乱码 分页
代码片段和文件信息
package com.trade.action;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import com.trade.dao.AdminerDao;
import com.trade.pojo.Adminer;
import com.util.MD5Code;
public class AdminAction {
private AdminerDao adminerDao;
private Adminer adminer;
private String msg;
private boolean flag;
private String idCard;
private String password;
private String loginmsg;
private HttpSession session = ServletActionContext.getRequest().getSession();
public String login() throws Exception{
String name=adminer.getAIdcard().trim();
String pwd =adminer.getAPwd().trim();
boolean flag = adminerDao.login(name new MD5Code().getMD5ofStr(pwd));
if(flag){
adminer = adminerDao.findByname(name);
session.setAttribute(“userId“ adminer.getAdminerId());
session.setAttribute(“adminerId“ adminer.getAIdcard());
session.setAttribute(“style“ adminer.getAstyle());
session.setAttribute(“username“ adminer.getAName());
return “suc“;
}
loginmsg = “用户名或密码错误!“;
return “err“;
}
public String addOperator() throws Exception{
System.out.println(!adminerDao.findName(adminer.getAName()));
if(!adminerDao.findName(adminer.getAName())){
msg=“有重复姓名,请重新注册“;
return “err“;
}
String pwd = adminer.getAPwd();
adminer.setAPwd(new MD5Code().getMD5ofStr(pwd));
adminer.setAstyle(2);
adminerDao.insertAdminer(adminer);
msg=“添加成功“;
session.setAttribute(“msg“ msg);
return “suc“;
}
public String isHasAdminer()throws Exception{
flag=adminerDao.findIs(idCard);
return “json“;
}
public String changePwd()throws Exception{
Adminer ad = adminerDao.findByid(adminer.getAdminerId());
if(ad.getAPwd().equals(new MD5Code().getMD5ofStr(password))){
ad.setAPwd(new MD5Code().getMD5ofStr(adminer.getAPwd()));
adminerDao.update(ad);
msg=“修改成功“;
}else{
msg=“原密码错误“;
return “err“;
}
return “suc“;
}
public AdminerDao getAdminerDao() {
return adminerDao;
}
public void setAdminerDao(AdminerDao adminerDao) {
this.adminerDao = adminerDao;
}
public Adminer getAdminer() {
return adminer;
}
public void setAdminer(Adminer adminer) {
this.adminer = adminer;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public boolean isFlag() {
return flag;
}
public void setFlag(boolean flag) {
this.flag = flag;
}
public String getIdCard() {
return idCard;
}
public void setIdCard(String idCard) {
this.idCard = idCard;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getLoginmsg() {
return loginmsg;
}
public void setLoginmsg(String loginmsg) {
this.loginmsg = loginmsg;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4823 2013-08-27 03:26 TradeManage2\.classpath
文件 539 2013-08-03 12:13 TradeManage2\.myhibernatedata
文件 306 2013-09-26 09:54 TradeManage2\.myme
文件 2164 2013-08-07 13:53 TradeManage2\.project
文件 488 2013-06-07 22:38 TradeManage2\.settings\.jsdtscope
文件 57 2013-08-04 20:18 TradeManage2\.settings\org.eclipse.core.resources.prefs
文件 364 2013-08-04 20:17 TradeManage2\.settings\org.eclipse.jdt.core.prefs
文件 471 2013-08-07 21:01 TradeManage2\.settings\org.eclipse.wst.common.component
文件 252 2013-08-07 21:01 TradeManage2\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2013-08-26 22:14 TradeManage2\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2013-08-26 22:14 TradeManage2\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 447 2013-06-13 16:57 TradeManage2\.springBeans
文件 1853 2013-08-26 22:46 TradeManage2\SQL Editor (0).sql
文件 2382 2013-09-04 08:41 TradeManage2\src\applicationContext.xm
文件 2964 2013-08-29 04:06 TradeManage2\src\com\trade\action\AdminAction.java
文件 4249 2013-08-07 14:49 TradeManage2\src\com\trade\action\ClientAction.java
文件 11578 2013-09-04 09:16 TradeManage2\src\com\trade\action\OrderLineAction.java
文件 8102 2013-09-04 09:01 TradeManage2\src\com\trade\action\ProductAction.java
文件 7271 2013-08-30 18:59 TradeManage2\src\com\trade\action\SupAction.java
文件 719 2013-08-29 04:01 TradeManage2\src\com\trade\dao\AdminerDao.java
文件 1004 2013-08-07 13:57 TradeManage2\src\com\trade\dao\ClientDao.java
文件 2107 2013-08-29 04:02 TradeManage2\src\com\trade\dao\impl\AdminerDaoImpl.java
文件 3488 2013-08-07 22:24 TradeManage2\src\com\trade\dao\impl\ClientDaoImpl.java
文件 5523 2013-08-29 03:55 TradeManage2\src\com\trade\dao\impl\OrderLineDaoImpl.java
文件 2487 2013-08-29 18:39 TradeManage2\src\com\trade\dao\impl\ProductDaoImpl.java
文件 1210 2013-08-03 13:34 TradeManage2\src\com\trade\dao\impl\StorageDaoImpl.java
文件 3012 2013-08-29 18:38 TradeManage2\src\com\trade\dao\impl\SupplierDaoImpl.java
文件 1122 2013-08-29 03:54 TradeManage2\src\com\trade\dao\OrderLineDao.java
文件 681 2013-08-29 18:38 TradeManage2\src\com\trade\dao\ProductDao.java
文件 414 2013-08-03 13:19 TradeManage2\src\com\trade\dao\StorageDao.java
............此处省略247个文件信息
评论
共有 条评论