package com.jeaw.ejgou.action.admin;
import java.util.HashSet;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.ServletContext;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.springframework.beans.BeanUtils;
import org.springframework.security.AccountExpiredException;
import org.springframework.security.BadCredentialsException;
import org.springframework.security.DisabledException;
import org.springframework.security.LockedException;
import com.jeaw.ejgou.entity.Admin;
import com.jeaw.ejgou.entity.Role;
import com.jeaw.ejgou.service.AdminService;
import com.jeaw.ejgou.service.ArticleService;
import com.jeaw.ejgou.service.MemberService;
import com.jeaw.ejgou.service.MessageService;
import com.jeaw.ejgou.service.OrderService;
import com.jeaw.ejgou.service.ProductService;
import com.jeaw.ejgou.service.RoleService;
import com.opensymphony.xwork2.interceptor.annotations.InputConfig;
import com.opensymphony.xwork2.validator.annotations.EmailValidator;
import com.opensymphony.xwork2.validator.annotations.RegexFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
import com.opensymphony.xwork2.validator.annotations.Validations;
import freemarker.ext.beans.BeansWrapper;
import freemarker.template.TemplateHashModel;
/**
* 后台Action类 - 后台管理、管理员
*/
@ParentPackage(“admin“)
public class AdminAction extends baseAdminAction {
private static final long serialVersionUID = -5383463207248344967L;
// Spring security 最后登录异常Session名称。
public static final String SPRING_SECURITY_LAST_EXCEPTION = “SPRING_SECURITY_LAST_EXCEPTION“;
private String loginUsername;
private Admin admin;
private List allRole;
private List roleList;
@Resource
private AdminService adminService;
@Resource
private RoleService roleService;
@Resource
private OrderService orderService;
@Resource
private MessageService messageService;
@Resource
private ProductService productService;
@Resource
private MemberService memberService;
@Resource
private ArticleService articleService;
@Resource
private ServletContext servletContext;
// 登录页面
public String login() {
String error = getParameter(“error“);
if (StringUtils.endsWithIgnoreCase(error “captcha“)) {
addActionerror(“验证码错误请重新输入!“);
return “login“;
}
Exception springSecurityLastException = (Exception)getSession(SPRING_SECURITY_LAST_EXCEPTION);
if (springSecurityLastException != null) {
if (springSecurityLastException instanceof BadCredentialsException) {
loginUsername = ((String)getSession(“SPRING_SECURITY_LAST_USERNAME“)).toLowerCase();
Admin admin = adminSer
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4084 2013-10-16 11:08 .classpath
文件 305 2015-09-17 18:19 .myme
文件 1419 2015-09-17 18:19 .project
目录 0 2015-05-31 14:58 .myeclipse\
目录 0 2015-05-31 15:13 .settings\
文件 500 2013-10-16 11:08 .settings\.jsdtscope
文件 1040 2013-10-16 11:08 .settings\com.genuitec.eclipse.j2eedt.core.prefs
文件 49 2013-10-16 11:08 .settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2013-10-16 11:08 .settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2015-09-17 18:27 docs\
文件 4671919 2013-10-16 11:08 docs\FreeMarker中文手册.pdf
文件 139264 2013-10-16 11:08 docs\IKAnalyzer中文分词器.doc
文件 0 2013-10-16 11:08 docs\代码修改记录.txt
文件 276480 2015-09-17 18:18 docs\电子商务平台开发指南.doc
文件 508070 2013-10-16 11:08 docs\表结构及初始化数据.sql
目录 0 2015-05-31 15:13 src\
目录 0 2015-05-31 15:13 src\main\
目录 0 2015-05-31 15:13 src\main\com\
目录 0 2015-05-31 15:13 src\main\com\jeaw\
目录 0 2015-05-31 15:13 src\main\com\jeaw\ejgou\
目录 0 2015-05-31 15:13 src\main\com\jeaw\ejgou\action\
目录 0 2015-05-31 15:13 src\main\com\jeaw\ejgou\action\admin\
文件 10477 2013-10-16 11:07 src\main\com\jeaw\ejgou\action\admin\AdminAction.java
文件 2507 2013-10-16 11:07 src\main\com\jeaw\ejgou\action\admin\AdminProfileAction.java
文件 1546 2013-10-16 11:07 src\main\com\jeaw\ejgou\action\admin\AgreementAction.java
文件 4663 2013-10-16 11:07 src\main\com\jeaw\ejgou\action\admin\AreaAction.java
文件 4418 2013-10-16 11:07 src\main\com\jeaw\ejgou\action\admin\ArticleAction.java
文件 4440 2013-10-16 11:07 src\main\com\jeaw\ejgou\action\admin\ArticleCategoryAction.java
文件 6799 2013-10-16 11:08 src\main\com\jeaw\ejgou\action\admin\ba
文件 6803 2013-10-16 11:08 src\main\com\jeaw\ejgou\action\admin\BrandAction.java
文件 10646 2013-10-16 11:07 src\main\com\jeaw\ejgou\action\admin\BuildHtmlAction.java
............此处省略1622个文件信息