📄 xxcustomlybaction.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.hnzt.struts.action;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.hnzt.dao.Dao;
public class XxcustomlybAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
Dao dao = new Dao();
int intPageSize = 5;
int intRowCount = 0;
String username = request.getSession().getAttribute("username").toString();
String strPage = request.getParameter("page");
int intPage;
if (strPage == null)
{
intPage = 1;
} else
{
intPage = Integer.parseInt(strPage);
if (intPage < 1)
intPage = 1;
}
int startPage = (intPage - 1) * intPageSize;
List rsall = null ;
List lybxx_rs = null;
rsall = dao.showdbid("Customlyb", "name", username);
if (rsall != null)
intRowCount = rsall.size();
int intPageCount = ((intRowCount + intPageSize) - 1) / intPageSize;
lybxx_rs = dao.listdb("Customlyb", startPage, intPageSize,username);
request.setAttribute("lybxx_rs", lybxx_rs);
Integer IPC = new Integer(intPageCount);
Integer IP = new Integer(intPage);
request.setAttribute("PageCount", IPC);
request.setAttribute("Pages", IP);
return mapping.findForward("success");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -