`
aa00aa00
  • 浏览: 331412 次
  • 性别: Icon_minigender_1
  • 来自: 沈阳
文章分类
社区版块
存档分类
最新评论

Struts+hibernate实现分页程序

阅读更多

package com.shisoft.Pager;

 

public class Pager {

 

    private int totalRows = 0; // 记录总数

 

    private int totalPages = 0; // 总页数

 

    private int pageSize = 10; // 每页显示数据条数,默认为 10 条记录

 

    private int currentPage = 1; // 当前页数

 

    private boolean hasPrevious = false ; // 是否有上一页

 

    private boolean hasNext = false ; // 是否有下一页

 

    public Pager() {

 

    }

 

    /**

      * Initialize Pager

      *

      * @param totalRows

      *             totalrecord rows

      * @param pageSize

      *             totalrecord is hold by every page

      */

    public void init( int totalRows, int pageSize) {

       this . totalRows = totalRows;

       this . pageSize = pageSize;

       totalPages = ((totalRows + pageSize) - 1) / pageSize;

       refresh(); // 刷新当前页面信息

    }

 

    /**

      *

      * @return Returns thecurrentPage.

      *

      */

 

    public int getCurrentPage() {

 

       return currentPage ;

 

    }

 

    /**

      *

      * @param currentPagecurrent

      *             page

      *

      */

 

    public void setCurrentPage( int currentPage) {

 

       this . currentPage = currentPage;

 

       refresh();

 

    }

 

    /**

      *

      * @return Returns thepageSize.

      *

      */

 

    public int getPageSize() {

 

       return pageSize ;

 

    }

 

    /**

      *

      * @param pageSize

      *             ThepageSize to set.

      *

      */

 

    public void setPageSize( int pageSize) {

 

       this . pageSize = pageSize;

 

       refresh();

 

    }

 

    /**

      *

      * @return Returns thetotalPages.

      *

      */

 

    public int getTotalPages() {

 

       return totalPages ;

 

    }

 

    /**

      *

      * @param totalPages

      *             ThetotalPages to set.

      *

      */

 

    public void setTotalPages( int totalPages) {

 

       this . totalPages = totalPages;

 

       refresh();

 

    }

 

    /**

      *

      * @return Returns thetotalRows.

      *

      */

 

    public int getTotalRows() {

 

       return totalRows ;

 

    }

 

    /**

      *

      * @param totalRows

      *             ThetotalRows to set.

      *

      */

 

    public void setTotalRows( int totalRows) {

 

       this . totalRows = totalRows;

 

       refresh();

 

    }

 

    // 跳到第一页

 

    public void first() {

 

       currentPage = 1;

 

       this .setHasPrevious( false );

 

       refresh();

 

    }

 

    // 取得上一页(重新设定当前页面即可)

 

    public void previous() {

 

       currentPage --;

 

       refresh();

 

    }

 

    // 取得下一页

 

    public void next() {

 

       if ( currentPage < totalPages ) {

 

           currentPage ++;

 

       }

 

       refresh();

 

    }

 

    public void doAction(String action) {

 

       if (action != null ) {

 

           // 根据传递进来的参数控制页面的前进后退

 

           if (action.equalsIgnoreCase( "previous" )) {

 

              this .previous();

 

           } else if (action.equalsIgnoreCase( "next" )) {

 

              this .next();

 

           } else if (action.equalsIgnoreCase( "first" )) {

 

              this .first();

 

           } else if (action.equalsIgnoreCase( "last" )) {

 

              this .last();

 

           } else {

              this .setCurrentPage(Integer.parseInt (action));

 

           }

 

       }

 

    }

 

    // 跳到最后一页

 

    public void last() {

 

       currentPage = totalPages ;

 

       this .setHasNext( false );

 

       refresh();

 

    }

 

    public boolean isHasNext() {

 

       return hasNext ;

 

    }

 

    /**

      *

      * @param hasNext

      *             ThehasNext to set.

      *

      */

 

    public void setHasNext( boolean hasNext) {

 

       this . hasNext = hasNext;

 

    }

 

    public boolean isHasPrevious() {

 

       return hasPrevious ;

 

    }

 

    /**

      *

      * @param hasPrevious

      *             ThehasPrevious to set.

      *

      */

 

    public void setHasPrevious( boolean hasPrevious) {

 

       this . hasPrevious = hasPrevious;

 

    }

 

    // 刷新当前页面信息

 

    public void refresh() {

 

       if ( totalPages <= 1) {

 

           hasPrevious = false ;

 

           hasNext = false ;

 

       } else if ( currentPage == 1) {

 

           hasPrevious = false ;

 

           hasNext = true ;

 

       } else if ( currentPage == totalPages ) {

 

           hasPrevious = true ;

 

           hasNext = false ;

 

       } else {

 

           hasPrevious = true ;

 

           hasNext = true ;

 

       }

 

    }

 

}

分页标签: PagerTag.java

package com.shisoft.Pager;

 

import javax.servlet.jsp.JspException;

import javax.servlet.jsp.JspWriter;

import javax.servlet.jsp.tagext.TagSupport;

 

/**

  * 通用分页标签的处理类

  */

public class PagerTag extends TagSupport {

    private String value = "" ;

 

    private String url = "" ;

   

    private String pagerStr = "" ;

 

    JspWriter out = null ;

 

    public int doStartTag() throws JspException {

       try {

           out = pageContext .getOut();

       } catch (Exception e) {

           e.printStackTrace();

       }

       BuildPagerBar();

       return SKIP_BODY ;

    }

 

    public int doEndTag() {

       return EVAL_PAGE ;

    }

 

    private void BuildPagerBar() {

       Pager pager = (Pager) pageContext .getSession().getAttribute( pagerStr );

       StringBuffer toolbar = new StringBuffer();

       toolbar

              .append( "<table table align=''center'' title='' 通用分页标签 '' width=''100%'' align=''center'' cellpadding=''0'' cellspacing=''0'' style=''FONT-SIZE: 9pt; BORDER-COLLAPSE: collapse''>" );

       toolbar.append( "<tr>" );

       toolbar.append( "<td width=60% > 共 " );

       toolbar.append( new Integer(pager.getTotalRows()).toString());

       toolbar.append( " 条记录 &nbsp; 第 " );

       toolbar.append( new Integer(pager.getCurrentPage()).toString());

       toolbar.append( "/" );

       toolbar.append( new Integer(pager.getTotalPages()).toString());

       toolbar.append( " 页 </td>" );

       toolbar.append( "<td align=right width=5%>" );

       toolbar.append( "<a href=''" );

       toolbar.append( url );

       toolbar.append( "?action=first''> 首页 </a>" );

       toolbar.append( "</td>" );

       toolbar.append( "<td align=''center'' width=''10%''>" );

       if (pager.isHasPrevious()) {

           toolbar.append( "<a href=''" );

           toolbar.append( url );

           toolbar.append( "?action=previous''> 上一页 </a>" );

       } else {

           toolbar.append( " 上一页 " );

       }

       toolbar.append( "|" );

       if (pager.isHasNext()) {

           toolbar.append( "<a href=''" );

           toolbar.append( url );

           toolbar.append( "?action=next''> 下一页 </a>" );

       } else {

           toolbar.append( " 下一页 " );

       }

       toolbar.append( "</td>" );

       toolbar.append( "<td align=left width=5%>" );

       toolbar.append( "<a href=''" );

       toolbar.append( url );

       toolbar.append( "?action=last''> 末页 </a>" );

       toolbar.append( "</td>" );

       toolbar.append( " <td align=''center'' width=20%>" );

       toolbar.append( "<FORM action=''" + url + "''>" );

       toolbar.append( " 跳转到 " + "<input name=''action'' size=''3'' />" );

       toolbar.append( "<INPUT type=''submit'' value=''GO''/>" );

       toolbar.append( "</FORM>" );

       toolbar.append( "</td>" );

       toolbar.append( "</tr></table>" );

       try {

           out .println(toolbar.toString());

       } catch (Exception e) {

           e.printStackTrace();

       }

    }

 

    public String getUrl() {

       return url ;

    }

 

    public void setUrl(String url) {

       this . url = url;

    }

 

    public String getValue() {

       return value ;

    }

 

    public void setValue(String value) {

       this . value = value;

    }

 

    /**

      * @return the pagerStr

      */

    public String getPagerStr() {

       return pagerStr ;

    }

 

    /**

      * @param pagerStr the pagerStr to set

      */

    public void setPagerStr(String pagerStr) {

       this . pagerStr = pagerStr;

    }

}

分页标签的 tld 文件: mylib.tld

<? xml version = "1.0" encoding = "UTF-8" ?>

<! DOCTYPE taglib

  PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"

  "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd" >

< taglib >

< tlibversion > 1.0 </ tlibversion >

  < jspversion > 1.1 </ jspversion >

  < shortname > utiltag </ shortname >

    < uri > http://beltino.com/util </ uri >

    < tag >

       < name > pager </ name >

       < tagclass > com.shisoft.Pager.PagerTag </ tagclass >

       < bodycontent > empty </ bodycontent >

       < attribute >

           < name > value </ name >

           < required > true </ required >

           < rtexprvalue > true </ rtexprvalue >

       </ attribute >

       < attribute >

           < name > url </ name >

           < required > true </ required >

           < rtexprvalue > true </ rtexprvalue >

       </ attribute >

       < attribute >

          < name > pagerStr </ name >

          < required > true </ required >

          < rtexprvalue > true </ rtexprvalue >

       </ attribute >

    </ tag >

</ taglib >

实体 bean : Bookand.java

package com.shisoft.bean;

 

/**

  * Bookand generated by MyEclipse Persistence Tools

  */

 

public class Bookand implements java.io.Serializable {

 

    // Fields

 

    private Integer id ;

    private String bookname ;

    private String author ;

    private Double price ;

 

    // Constructors

 

    /** default constructor */

    public Bookand() {

    }

 

    /** full constructor */

    public Bookand(String bookname, String author, Double price) {

       this . bookname = bookname;

       this . author = author;

       this . price = price;

    }

 

    // Property accessors

 

    public Integer getId() {

       return this . id ;

    }

 

    public void setId(Integer id) {

       this . id = id;

    }

 

    public String getBookname() {

       return this . bookname ;

    }

 

    public void setBookname(String bookname) {

       this . bookname = bookname;

    }

 

    public String getAuthor() {

       return this . author ;

    }

 

    public void setAuthor(String author) {

       this . author = author;

    }

 

    public Double getPrice() {

       return this . price ;

    }

 

    public void setPrice(Double price) {

       this . price = price;

    }

 

}

实体操作类: dao 文件

package com.shisoft.bean;

 

import java.util.List;

 

import org.apache.commons.logging.Log;

import org.apache.commons.logging.LogFactory;

import org.hibernate.LockMode;

import org.hibernate.Query;

import org.hibernate.Session;

import org.hibernate.criterion.Example;

 

/**

  * Data access object (DAO) for domain model class Bookand.

  *

  * @see com.shisoft.bean.Bookand

  * @author MyEclipse Persistence Tools

  */

 

public class BookandDAO extends BaseHibernateDAO {

    private static final Log log = LogFactory.getLog (BookandDAO. class );

    // property constants

    public static final String BOOKNAME = "bookname" ;

    public static final String AUTHOR = "author" ;

    public static final String PRICE = "price" ;

 

    public void save(Bookand transientInstance) {

       log .debug( "saving Bookand instance" );

       try {

           getSession().save(transientInstance);

           log .debug( "save successful" );

       } catch (RuntimeException re) {

           log .error( "save failed" , re);

           throw re;

       }

    }

 

    public void delete(Bookand persistentInstance) {

       log .debug( "deleting Bookand instance" );

       try {

           getSession().delete(persistentInstance);

           log .debug( "delete successful" );

       } catch (RuntimeException re) {

           log .error( "delete failed" , re);

           throw re;

       }

    }

 

    public Bookand findById(java.lang.Integer id) {

       log .debug( "getting Bookand instance with id: " + id);

       try {

           Bookand instance = (Bookand) getSession().get(

                  "com.shisoft.bean.Bookand" , id);

           return instance;

       } catch (RuntimeException re) {

           log .error( "get failed" , re);

           throw re;

       }

    }

 

    public List findByExample(Bookand instance) {

       log .debug( "finding Bookand instance by example" );

       try {

           List results = getSession().createCriteria(

                  "com.shisoft.bean.Bookand" ).add(Example.create (instance))

                  .list();

           log .debug( "find by example successful, result size: "

                  + results.size());

           return results;

       } catch (RuntimeException re) {

           log .error( "find by example failed" , re);

           throw re;

       }

    }

 

    public List findByProperty(String propertyName, Object value) {

       log .debug( "finding Bookand instance with property: " + propertyName

              + ", value: " + value);

       try {

           String queryString = "from Bookand as model where model."

                  + propertyName + "= ?" ;

           Query queryObject = getSession().createQuery(queryString);

           queryObject.setParameter(0, value);

           return queryObject.list();

       } catch (RuntimeException re) {

           log .error( "find by property name failed" , re);

           throw re;

       }

    }

 

    public List findByBookname(Object bookname) {

       return findByProperty( BOOKNAME , bookname);

    }

 

    public List findByAuthor(Object author) {

       return findByProperty( AUTHOR , author);

    }

 

    public List findByPrice(Object price) {

       return findByProperty( PRICE , price);

    }

 

    public List findAll() {

       log .debug( "finding all Bookand instances" );

       try {

           Session s=getSession();

           String queryString = "from Bookand" ;

           Query queryObject = s.createQuery(queryString);

           List l=queryObject.list();

          

           return l;

       } catch (RuntimeException re) {

           re.printStackTrace();

           log .error( "find all failed" , re);

           throw re;

       }

    }

    public List findAllByPage( int firstrows, int pagesize) {

       log .debug( "finding all Bookand instances" );

       try {

           Session s=getSession();

           String queryString = "from Bookand" ;

           Query queryObject = s.createQuery(queryString);

           queryObject.setMaxResults(pagesize);

           queryObject.setFirstResult(firstrows);

           List l=queryObject.list();

          

           return l;

       } catch (RuntimeException re) {

           re.printStackTrace();

           log .error( "find all failed" , re);

           throw re;

       }

    }

 

    public Bookand merge(Bookand detachedInstance) {

       log .debug( "merging Bookand instance" );

       try {

           Bookand result = (Bookand) getSession().merge(detachedInstance);

           log .debug( "merge successful" );

           return result;

       } catch (RuntimeException re) {

           log .error( "merge failed" , re);

           throw re;

       }

    }

 

    public void attachDirty(Bookand instance) {

       log .debug( "attaching dirty Bookand instance" );

       try {

           getSession().saveOrUpdate(instance);

           log .debug( "attach successful" );

       } catch (RuntimeException re) {

           log .error( "attach failed" , re);

           throw re;

       }

    }

 

    public void attachClean(Bookand instance) {

       log .debug( "attaching clean Bookand instance" );

       try {

           getSession().lock(instance, LockMode. NONE );

           log .debug( "attach successful" );

       } catch (RuntimeException re) {

           log .error( "attach failed" , re);

           throw re;

       }

    }

    public static void main(String [] args){

       BookandDAO dao = new BookandDAO();

       System. out .println( "-=----" );

       List results = dao.findAll();

       System. out .println(results.size());

       for ( int i=0;i<results.size();i++) {

 

           Bookand bookand= new Bookand();

           System. out .println( "===========" );

           System. out .println(bookand.getBookname());

       }

    }

}

Action 中代码:

package com.shisoft.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.shisoft.Pager.Pager;

import com.shisoft.bean.BookandDAO;

 

public class PagerAction extends Action {

 

    public ActionForward execute(ActionMapping mapping, ActionForm form,

           HttpServletRequest request, HttpServletResponse response){

       Pager pager= null ;

       BookandDAO dao = new BookandDAO();

       List results = dao.findAll();

       try {

            

           if (request.getSession().getAttribute( "pagerstruts" ) == null ) {

              pager = new Pager();

             

              int totalRows =results.size();

              pager.init(totalRows,3);

           } else {

              pager = (Pager) request.getSession().getAttribute( "pagerstruts" );

           }

           if (request.getParameter( "action" ) != null ) {

              pager.doAction(request.getParameter( "action" ).toString());

           }

          

           List list = dao.findAllByPage((pager.getCurrentPage() - 1)* pager.getPageSize(),pager.getPageSize());

           request.getSession().setAttribute( "pagerstruts" ,pager);

           request.setAttribute( "list" , list);

           } catch (Exception re) {

              re.printStackTrace();

           }

       return mapping.findForward( "success" );

    }

}

 

Jsp 页面:

<%@ page language = "java" import = "java.util.*" pageEncoding = "gb2312" %>

<%@ taglib uri = "http://struts.apache.org/tags-bean" prefix = "bean" %>

<%@ taglib uri = "http://struts.apache.org/tags-html" prefix = "html" %>

<%@ taglib uri = "http://struts.apache.org/tags-logic" prefix = "logic" %>

<%@ taglib uri = "/WEB-INF/mylib.tld" prefix = "pager" %>

< html >

  < head >

    < title > 分页 </ title >

   

    < meta http-equiv = "pragma" content = "no-cache" >

    < meta http-equiv = "cache-control" content = "no-cache" >

    < meta http-equiv = "expires" content = "0" >    

    < meta http-equiv = "keywords" content = "keyword1,keyword2,keyword3" >

    < meta http-equiv = "description" content = "This is my page" >

    <!--

    <link rel="stylesheet" type="text/css" href="styles.css">

    -->

 

  </ head >

 

  < body >

   < table width = "100%" align = "center" border = "1" cellpadding = "0"

           cellspacing = "0" bordercolor = "#ffc46c" >

           < tr >

              < td align = "center" >

                  书名

              </ td >

              < td align = "center" >

                  作者

              </ td >

              < td align = "center" >

                  价钱

              </ td >

           </ tr >

           < logic:iterate id = "u" name = "list" >

              < tr >

                  < td >

                     < bean:write name = "u" property = "bookname" />

                  </ td >

                  < td align = "center" >

                     < bean:write name = "u" property = "author" />

                  </ td >

                  < td align = "center" >

                     < bean:write name = "u" property = "price" />

                  </ td >

              </ tr >

             

           </ logic:iterate >

           < tr >

                 < td colspan = "3" >

                

                   < pager:pager value = "pager" url = "pager.do" pagerStr = "pagerstruts" />

                  

                 </ td >

              </ tr >

       </ table >

  </ body >

</ html >

Struts 配置文件

<? xml version = "1.0" encoding = "UTF-8" ?>

<! DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd" >

 

< struts-config >

  < form-beans >

     < form-bean name = "pagerForm" type = "com.shisoft.struts.form.PagerForm" />

  </ form-beans >

  < global-exceptions />

  < global-forwards >

   < forward name = "pager" path = "/pager.do" ></ forward >

  </ global-forwards >

  < action-mappings >

    < action path = "/pager"

    type = "com.shisoft.struts.action.PagerAction"

    scope = "request" >

       < forward name = "success"

       path = "/ok.jsp" ></ forward >

    </ action >

  </ action-mappings >

  < message-resources parameter = "com.shisoft.struts.ApplicationResources" />

</ struts-config >

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yhj821129/archive/2009/08/11/4430746.aspx

分享到:
评论

相关推荐

    Struts+Hibernate实现分页

    本篇将介绍如何使用Struts和Hibernate框架来实现Web应用中的分页功能。 首先,Struts是一个基于MVC(Model-View-Controller)设计模式的Java Web框架,它负责处理用户请求并控制应用程序的流程。而Hibernate则是一...

    Struts2+HIBERNATE实现分页(完整讲解)

    【Struts2+Hibernate实现分页详解】 在Java Web开发中,Struts2和Hibernate是两个非常重要的框架,它们分别负责MVC模式中的控制层和持久层。Struts2提供了强大的Action类和拦截器,使得业务逻辑处理更加简洁;而...

    Struts + Hibernate 实现简单分页功能

    本篇将详细讲解如何利用Struts和Hibernate来实现一个简单的分页功能。 首先,我们需要理解分页的基本原理。分页是为了提高用户体验,避免一次性加载大量数据导致页面加载慢或内存压力过大。在Web应用中,我们通常将...

    STRUTS2+HIBERNATE详细的分页实现代码详细的分页实现代码

    根据提供的标题、描述、标签及部分内容,我们可以了解到这篇文章主要探讨的是如何在Struts2与Hibernate框架结合下实现分页功能。接下来将详细解析Struts2与Hibernate如何协作完成这一任务。 ### Struts2与Hibernate...

    struts+hibernate做的分页显示

    在这个项目中,"struts+hibernate做的分页显示"主要是利用这两者来实现数据的分页展示,提升用户体验,降低服务器压力。 首先,Struts是一个基于MVC设计模式的Java Web框架,它简化了开发过程,提供了处理HTTP请求...

    struts+hibernate+spring集成实现分页

    在分页实现中,Struts可以通过Action类接收用户的请求参数,如当前页码和每页显示条目数,然后调用相应的Service层方法来获取分页数据。 Spring框架则提供了一个容器,用来管理对象的生命周期和依赖关系,以及事务...

    Struts + Hibernate 分页实现

    在"Struts + Hibernate 分页实现"这个项目中,重点在于如何在Web应用中整合这两个框架,并实现数据的分页显示。分页是大型数据集处理时常见的需求,它能够帮助用户更有效地浏览和管理大量信息,避免一次性加载所有...

    struts+hibernate实现分页.rar

    本项目“struts+hibernate实现分页”结合了这两个强大的工具,旨在展示如何在实际应用中实现数据的分页显示,以提高用户体验并优化系统性能。 分页是Web应用程序中常见的功能,特别是在处理大量数据时。它将数据库...

    用Struts+Hibernate做的分页

    通过这个项目,开发者可以学习到如何在Struts和Hibernate的集成环境下实现分页功能,理解MVC架构下各层的职责,以及如何使用Hibernate进行数据库操作。此外,还能了解到如何在前端展示分页信息,提高用户体验。这是...

    STRUTS+ HIBERNATE 简单分页

    在大型项目中,为了提高用户体验,通常需要实现数据的分页展示,这正是"STRUTS+ HIBERNATE 简单分页"的主题。 首先,我们要理解分页的基本原理。分页主要是将大量数据分成若干小块,每次只加载一部分到页面上,这样...

    Struts2 + Hibernate3 分页程序

    在这个"Struts2 + Hibernate3 分页程序"中,我们将探讨如何在它们的集成环境下实现分页功能。 分页是Web应用中常见的功能,它允许用户以较小的数据块浏览大量数据,提高用户体验。在Hibernate3中,虽然没有提供内置...

    Struts+Hibernate+分页

    在给定的文件名"StrutsHibernate"中,我们可以推测这是一个包含Struts和Hibernate整合示例的工程,可能包含了配置文件、Action类、DAO(数据访问对象)类以及相关的JSP页面。通过分析这个项目,开发者可以学习如何在...

    Struts+Hibernate完成分页笔记

    在本文中,我们将深入探讨如何使用Struts和Hibernate框架来实现高效的分页功能。Struts作为MVC(Model-View-Controller)架构的一部分,主要负责处理用户请求和控制应用程序流程,而Hibernate则是一个强大的对象关系...

    struts+spring+hibernate通用分页方法

    struts+spring+hibernate通用分页方法.rar 博文链接:https://igogogo9.iteye.com/blog/97692

    spring+struts+hibernate实现分页

    总的来说,通过Spring、Struts和Hibernate的集成,我们可以构建出一个强大的Web应用框架,其中分页功能的实现主要依赖于Spring管理的SessionFactory、Struts的Action和Spring的IoC容器,以及自定义的PageUtil和Page...

    Struts+Hibernate+Spring的分页

    在这个"Struts+Hibernate+Spring的分页"项目中,开发者展示了如何在这样的集成环境下实现分页功能。分页是Web应用中常见的需求,它允许用户逐页浏览大量的数据,提高用户体验并减轻服务器压力。 首先,我们来看看...

    struts+hibernate+sql server2005分页的小项目

    本项目以"Struts+Hibernate+SQL Server 2005"的技术栈实现了一个简单的分页小项目,下面我们将详细探讨这个项目中的关键技术点。 **1. Struts框架** Struts是Apache组织下的一个开源MVC框架,主要用于构建Java Web...

    在struts+hibernate框架下实现动态分页

    在Struts和Hibernate这两个流行的Java Web开发框架的组合中,实现动态分页是一项常见的需求。动态分页允许用户浏览大量的数据,而不会一次性加载所有记录,从而提高用户体验和系统性能。下面将详细介绍如何在Struts...

    使用Struts + Spring + Hibernate完成分页笔记

    在分页实现中,Spring可以管理Struts的Action类以及Hibernate的数据访问对象(DAO)。通过Spring的IOC(Inversion of Control,控制反转),我们可以将DAO的实例注入到Action中,使得Action无需关心DAO的具体创建...

Global site tag (gtag.js) - Google Analytics