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

📄 useraction.java

📁 SSH的平台搭建
💻 JAVA
字号:
package com.lovo.zengxy.struts.action;

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

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.lovo.zengxy.base.web.action.BaseAction;
import com.lovo.zengxy.util.BaseDAOException;
import com.lovo.zengxy.util.PageUtil;
import com.lovo.zengxy.web.service.UserService;

public class UserAction extends BaseAction{
	
	
	private UserService userService;

	public UserService getUserService() {
		return userService;
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	
	public ActionForward userShow(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		ActionForward forword = null;
			String Page = request.getParameter("nowPage");
			int nowPage = 1;
			if(Page!=null){
				nowPage = new Integer(Page);
			}
			try {
				request.setAttribute("uList", this.userService.findUserListPage(nowPage, 15));
				int totalCount = this.userService.getUserTotaleCount();
				System.err.println("数据库中的总数据条数"+totalCount);
				PageUtil pageUtil = new PageUtil(nowPage,totalCount,15,"user.do?method=userShow&");
				request.setAttribute("pageInfo", pageUtil.getPageContent());
				forword = mapping.findForward("ok");
			} catch (BaseDAOException e) {
				super.getLog().error("分页错误",e);
				forword = mapping.findForward("cuowu");
				e.printStackTrace();
			}
		return forword;
	}

}

⌨️ 快捷键说明

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