Java另一种分页技术
整体系统采用Java中Spring ,Struts, Hibernate组成。
在Action中:
public ActionForward orgview(ActionMapping mapping, ActionForm form,HttpServletRequest request,HttpServletResponse response) {
// TODO Auto-generated method stub
ActionForward forward = new ActionForward("strpath");
HttpSession session=request.getSession();
String usrid=(String) session.getAttribute("uid");
BxGoods goods=new BxGoods(); //表名
String whe_str=" where c.collectType=0 and c.userId='"+usrid+"'"; //查询的SQL语句
String tableName=" BxCollectGoods as c "; //表名
int dipage =1;
int pageSize =10;
int count = currentPage.allRecord(tableName, whe_str);
int allPage = currentPage.allPage(count, pageSize);
Object d=request.getParameter("d");
if(d!=null)
dipage=Integer.valueOf(d.toString());
List list_cg = currentPage.currentPage(tableName, whe_str, dipage, pageSize, allPage);
List list=new ArrayList();
Iterator iter=list_cg.iterator();
while(iter.hasNext()){
BxCollectGoods cg =(BxCollectGoods) iter.next();
CollectGoods cgBean=new CollectGoods();
String collectname = cg.getCollectName();
String collectId = cg.getCollectId();
goods =goodsDAO.findById(cg.getCollectId());
BxUser bx_user = userDAO.findById(goods.getUserId());
cgBean.setSellerName(bx_user.getUserName());
BxUser user =userDAO.findById(cg.getUserId());
cgBean.setBuyId(cg.getUserId());
cgBean.setCollectName(cg.getCollectName());
cgBean.setCollectType(cg.getCollectType());
cgBean.setRecaddTime(cg.getAddTime());
cgBean.setCollectId(cg.getCollectId());
cgBean.setShopPrice(goods.getShopPrice());
cgBean.setGoodsName(goods.getGoodsName());
cgBean.setRecId(cg.getRecId());
cgBean.setGoodsImg(goods.getGoodsThumb());
list.add(cgBean);
}
request.setAttribute("list", list);
request.setAttribute("d",dipage);
request.setAttribute("count",count);
request.setAttribute("allPage",allPage
相关文档:
安装开发环境
ubuntu9.10下安装JAVA开发环境其实还是比较简单的,我们就以安装常用的jdk、eclipse、tomcat、svn client(找到一个可以和windows中的小乌龟类似的但安装还有点问题解决后会补上)、oracle client为例讲讲如何安装(本文中自动化安装脚本下载http://download.csdn.net/source/2034239,文件太大分成6份 )。前 ......
来自:http://www.cnblogs.com/echozhjun/archive/2010/01/08/1641970.html
JDK Logger
JDK Logger在java.util.logging包下面,自从JDK1.4就有了,可是因为log4j的存在,这个Logger一直沉默着。Java自带的Logger,级别比Log4j还要详细,但是如果需要自定义日志输出格式,需要自己实现Formatter,有些不方便。
Log4j  ......
Java的数据结构有哪些?Map与Set的本质区别是什么?
分析:Java常见的数据结构有Collection和Map,其中Collection接口下包括List和Set接口,其下又有多个实现类如List下有ArrayList、LinkedList和Vector等实现类,Set下有HashSet、LinkedSet等实现类和SortedSet接口,HashSet下有LinkedHashSet子类,SortedSet接口下有Tre ......
inkfish翻译,请勿商业性质转载,转载请注明来源(http://blog.csdn.net/inkfish
)。本文是我学习JUEL同时,对原网站进行的简单的翻译,原网站地址:http://juel.sourceforge.net/
JUEL
是统一表达式语言(Unified Expression Language
, EL
)的一个实现,是JSP 2.1
标准(JSR-245
)的一部分,已经作为Ja ......