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

📄 managementindexaction.java

📁 这个是完整的wap项目的源码 开发语言 Java 系统架构 Struts + hibernate + spring 数据库 Mysql5.0 应用服务器Tomcat5.0 开发工具 MyEc
💻 JAVA
字号:
package com.longtime.wap.frame.web.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.springframework.web.struts.ActionSupport;

import com.longtime.wap.common.WapConstant;
import com.longtime.wap.common.enums.GroupEnum;
import com.longtime.wap.frame.common.FrameConstant;
import com.longtime.wap.frame.common.UserSessionVO;
import com.longtime.wap.frame.service.ManagementIndexService;

/**
 * 处理用户跳转后台管理页面的action
 * 
 * @author bulc
 * @date 2007-11-3
 */
public class ManagementIndexAction extends ActionSupport {
	private static final Log LOGGER = 
		LogFactory.getLog(ManagementIndexAction.class);
	ManagementIndexService managementIndexService;

	/**
	 * 由spring的IOC容器的注入service对象
	 * 
	 * @param managementIndexService
	 *            managementIndexService对象
	 */
	public void setManagementIndexService(
			ManagementIndexService managementIndexService) {
		this.managementIndexService = managementIndexService;
	}

	/**
	 * 处理跳转到后台管理页面的请求的方法
	 * 
	 * @param mapping
	 *            action mapping对象
	 * @param form
	 *            表单对象
	 * @param request
	 *            request对象
	 * @param response
	 *            response对象
	 * @return 转向页面
	 * @throws Exception
	 * 				异常
	 */
	@Override
	public ActionForward execute(ActionMapping mapping, 
			ActionForm form,
			HttpServletRequest request, 
			HttpServletResponse response)
			throws Exception {
		try {
			// 为后台页面显示准备初始化数据
			int informationCount = this.managementIndexService
					.getInformationCount();
			int tempSaveInformationCount = informationCount
					- this.managementIndexService.getPubInformationCount();
			int cpAdminCount = this.managementIndexService.getCPAdminCount();

			// 信息总数
			request.setAttribute(FrameConstant.INFO_COUNT, informationCount);
			// 暂存总数
			request.setAttribute(FrameConstant.TEMP_SAVE_INFO_COUNT,
					tempSaveInformationCount);
			// cp管理员的总数
			request.setAttribute(FrameConstant.CP_ADMIN_COUNT, cpAdminCount);

			UserSessionVO usVo = (UserSessionVO) request.getSession()
				.getAttribute(WapConstant.USER_SESSION);
			// 当前用户的角色
			request.setAttribute(FrameConstant.USER_GROUP, GroupEnum.getValue(
					usVo.getUserGroup()).toChinese());
		} catch (Exception ex) {
			LOGGER.error(ex);
			ex.printStackTrace();
		}
		return mapping.findForward("success");
	}
}

⌨️ 快捷键说明

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