listsysrolewithpage.java.svn-base

来自「用JSP JAVA 做的 系统 只是初来扎到还望西黄!别乱来哦!」· SVN-BASE 代码 · 共 41 行

SVN-BASE
41
字号
package com.chis.model.user;

import com.stframe.dao.DaoUtil;
import com.stframe.dao.PageUtil;
import com.stframe.form.ActionForm;
import com.stframe.servlet.ActionInstance;
/**
 * 带分页的角色列表
 * @author zxh
 *
 */
public class ListSysRoleWithPage extends ActionInstance {

	public int execute(ActionForm af) throws Exception {
		String hbdwbh = (String) af.getHttpSession().getAttribute("HBDWBH");
		int currentpage = 0;
		int pagesize = 30;
		
		StringBuffer sbsql = new StringBuffer();
		StringBuffer sbpath = new StringBuffer();
		
		//拼凑SQL语句和PATH路径
		sbsql.append("SELECT * FROM SYS_ROLE WHERE 1=1 and CORP_ID='"+hbdwbh+"'");
		sbpath.append(af.getHttpRequest().getContextPath()+"/Selevet.do?action=BASE_SYSROLE_LIST");

		try {
			currentpage = Integer.parseInt(af.getHttpRequest().getParameter("currentpage"));
		} catch (Exception e) {
			currentpage = 1;
		}
		
		PageUtil pageUtil = (PageUtil)DaoUtil.selectPage(af.getConnection(),sbsql.toString(),currentpage, pagesize);
		pageUtil.setPath(sbpath.toString());
		
		af.getHttpRequest().setAttribute("rolelist",pageUtil.getContext());
		af.getHttpRequest().setAttribute("pagebar", pageUtil.pageBar());
		return 1;
	}

}

⌨️ 快捷键说明

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