最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

springmvc 分頁(yè)查詢的簡(jiǎn)單實(shí)現(xiàn)示例代碼

 更新時(shí)間:2017年01月05日 15:15:35   作者:GreenRookie  
我們?cè)陂_(kāi)發(fā)項(xiàng)目中很多項(xiàng)目都用到列表分頁(yè)功能,本篇介紹了springmvc 分頁(yè)查詢的簡(jiǎn)單實(shí)現(xiàn)示例代碼,非常具有實(shí)用價(jià)值,需要的朋友可以參考下。

目前較常用的分頁(yè)實(shí)現(xiàn)辦法有兩種:

1.每次翻頁(yè)都修改SQL,向SQL傳入相關(guān)參數(shù)去數(shù)據(jù)庫(kù)實(shí)時(shí)查出該頁(yè)的數(shù)據(jù)并顯示。

2.查出數(shù)據(jù)庫(kù)某張表的全部數(shù)據(jù),再通過(guò)在業(yè)務(wù)邏輯里面進(jìn)行處理去取得某些數(shù)據(jù)并顯示。

對(duì)于數(shù)據(jù)量并不大的簡(jiǎn)單的管理系統(tǒng)而言,第一種實(shí)現(xiàn)方法相對(duì)來(lái)說(shuō)容易使用較少的代碼實(shí)現(xiàn)分頁(yè)這一功能,本文也正是為大家介紹這種方法:

代碼片段:

1,Page.java

package com.cm.contract.common; 
 
import org.apache.commons.lang.StringUtils; 
import org.apache.commons.lang.builder.ToStringBuilder; 
 
 
 
/**分頁(yè)類 
 * @author FENGWEI 
 * @date 2016-5-23 
 */ 
public class Page implements java.io.Serializable{ 
   
  private static final long serialVersionUID = 1L; 
  //前一頁(yè) 
  private Boolean hasPrePage; 
  //后一頁(yè) 
  private Boolean hasNextPage; 
  //每頁(yè)顯示多少條:默認(rèn)20條 
  private Long everyPage = 20L; 
  //總頁(yè)數(shù) 
  private Long totalPage; 
  //當(dāng)前第多少頁(yè):默認(rèn)第1頁(yè) 
  private Long currentPage = 1L; 
  //開(kāi)始下標(biāo) 
  private Long beginIndex; 
  //結(jié)束下標(biāo) 
  private Long endinIndex; 
  //總共多少條 
  private Long totalCount;   
  //排序列名 
  private String sortName;   
  //排序狀態(tài) 
  private String sortState;   
  //排序信息 
  private String sortInfo; 
  //是否排序 
  private Boolean sort = false; 
  private String defaultInfo = " "; 
   
   
   
  public String getDefaultInfo() { 
    return defaultInfo; 
  } 
 
  public void setDefaultInfo(String defaultInfo) { 
    this.defaultInfo = defaultInfo; 
  } 
 
  public String getSortInfo() { 
    return sortInfo; 
  } 
 
  public void setSortInfo(String sortInfo) { 
    this.sortInfo = sortInfo; 
  } 
 
  public String getSortName() { 
    return sortName; 
  } 
 
  public void setSortName(String sortName) { 
    setPageSortState(sortName);    
  } 
 
  public String getSortState() { 
    return sortState; 
  } 
 
  public void setSortState(String sortState) { 
    this.sortState = sortState; 
  } 
 
   
  public Page() { 
  } 
 
  /** 
   * 常用,用于計(jì)算分頁(yè) 
   * */ 
  public Page(Long totalRecords){    
    this.totalCount = totalRecords; 
    setTotalPage(getTotalPage(totalRecords));    
  } 
   
  /** 
   * 設(shè)置每頁(yè)顯示多少條時(shí)使用 
   * */ 
  public Page(Long everyPage,Long totalRecords){  
    this.everyPage = everyPage; 
    this.totalCount = totalRecords; 
    setTotalPage(getTotalPage(totalRecords));    
  } 
   
  /** 
   * @param state  狀態(tài)碼 
   * @param value  到第多少頁(yè)或者設(shè)置每頁(yè)顯示多少條或者為排序列名 
   */ 
  public void pageState(int index,String value) {         
    sort = false; 
    switch (index) { 
    case 0 :setEveryPage(Long.parseLong(value));break; 
    case 1 :first();break; 
    case 2: previous();break; 
    case 3: next();break; 
    case 4: last();break; 
    case 5: sort = true;sort(value);break; 
    case 6 ://到指定第多少頁(yè) 
      setCurrentPage(Long.parseLong(value)); 
      break;      
    } 
  } 
 
  /** 
   * 最前一頁(yè) 
   */ 
  private void first() { 
    currentPage = 1L; 
  } 
 
  private void previous() { 
    currentPage--; 
  } 
 
  private void next() { 
    currentPage++; 
  } 
 
  private void last() { 
    currentPage = totalPage; 
  } 
 
  private void sort(String sortName) {     
    //設(shè)置排序狀態(tài) 
    setPageSortState(sortName);    
  } 
     
   
   
  /** 
   * 計(jì)算總頁(yè)數(shù) 
   * */ 
  private Long getTotalPage(Long totalRecords) { 
     Long totalPage = 0L;   
     everyPage = everyPage == null ? 10L : everyPage; 
     if (totalRecords % everyPage == 0) 
      totalPage = totalRecords / everyPage; 
     else { 
      totalPage = totalRecords / everyPage + 1; 
     } 
     return totalPage; 
  }   
   
 
  public Long getBeginIndex() { 
    this.beginIndex = (currentPage - 1) * everyPage; 
    return this.beginIndex; 
  } 
 
  public void setBeginIndex(Long beginIndex) { 
    this.beginIndex = beginIndex; 
  } 
 
  public Long getCurrentPage() { 
    this.currentPage = currentPage == 0 ? 1 : currentPage; 
    return this.currentPage; 
  } 
 
  public void setCurrentPage(Long currentPage) { 
    if(0 == currentPage){ 
      currentPage = 1L; 
    } 
    this.currentPage = currentPage; 
  } 
 
  public Long getEveryPage() { 
    this.everyPage = everyPage == 0 ? 10 : everyPage; 
    return this.everyPage; 
  } 
 
  public void setEveryPage(Long everyPage) {    
    this.everyPage = everyPage; 
  } 
 
  public Boolean getHasNextPage() { 
    this.hasNextPage = (currentPage != totalPage) && (totalPage != 0); 
    return this.hasNextPage; 
  } 
 
  public void setHasNextPage(Boolean hasNextPage) { 
    this.hasNextPage = hasNextPage; 
  } 
 
  public Boolean getHasPrePage() { 
    this.hasPrePage = currentPage != 1; 
    return this.hasPrePage; 
  } 
 
  public void setHasPrePage(Boolean hasPrePage) { 
    this.hasPrePage = hasPrePage; 
  } 
 
  public Long getTotalPage() { 
    return this.totalPage; 
  } 
 
  public void setTotalPage(Long totalPage) { 
    if(this.currentPage > totalPage){ 
      this.currentPage = totalPage; 
    } 
    this.totalPage = totalPage; 
  } 
 
  public Long getTotalCount() { 
    return this.totalCount; 
  } 
 
  public void setTotalCount(Long totalCount) { 
    setTotalPage(getTotalPage(totalCount));  
    this.totalCount = totalCount; 
  } 
 
  @Override 
  public String toString() { 
    return ToStringBuilder.reflectionToString(this); 
  } 
   
  /** 
   * 設(shè)置排序狀態(tài) 
   * */ 
  private void setPageSortState(String newPageSortName){    
    //判斷之前的排序字段是否為空 
    if(StringUtils.isEmpty(sortName)){ 
      //默認(rèn)排序?yàn)樯?
      this.sortState = PageUtil.ASC;    
      this.sortInfo = PageUtil.PAGE_ASC;            
    }else{ 
      if(StringUtils.equalsIgnoreCase(newPageSortName, sortName)){ 
        //判斷sortState排序狀態(tài)值 
        if(StringUtils.equalsIgnoreCase(sortState, PageUtil.ASC)){ 
          this.sortState = PageUtil.DESC; 
          this.sortInfo = PageUtil.PAGE_DESC;                
        }else{ 
          this.sortState = PageUtil.ASC; 
          this.sortInfo = PageUtil.PAGE_ASC;          
        }         
      }else{ 
        //默認(rèn) 
        this.sortState = PageUtil.ASC;    
        this.sortInfo = PageUtil.PAGE_ASC; 
      } 
    } 
    sortName = newPageSortName.toLowerCase();       
  } 
 
  public Boolean isSort() { 
    return sort; 
  } 
 
  public void setSort(Boolean sort) { 
    this.sort = sort; 
  } 
 
 
  public Long getEndinIndex() { 
    this.endinIndex = (currentPage) * everyPage; 
    return endinIndex; 
  } 
 
  public void setEndinIndex(Long endinIndex) { 
    this.endinIndex = endinIndex; 
  }   
} 

2.PageState.java

package com.cm.contract.common; 
 
import org.apache.commons.lang.StringUtils; 
 
 
 
 
/**分頁(yè)狀態(tài)類 
 * @author FENGWEI 
 * @date 2016-5-23 
 */ 
public enum PageState { 
   
  /** 
   * 設(shè)置每頁(yè)顯示多少條 
   * */ 
  SETPAGE, 
  /** 
   * 首頁(yè) 
   * */ 
  FIRST,  
  /** 
   * 向前一頁(yè) 
   * */ 
  PREVIOUS,  
  /** 
   * 向后一頁(yè) 
   * */ 
  NEXT,  
  /** 
   * 末頁(yè) 
   * */ 
  LAST,  
  /** 
   * 排序 
   * */ 
  SORT, 
  /** 
   * 到第多少頁(yè) 
   * */ 
  GOPAGE; 
 
   
  /** 
   * @param value 索引名稱 
   * @return 返回索引下標(biāo) 
   */ 
  public static int getOrdinal(String value) { 
    int index = -1; 
    if (StringUtils.isEmpty(value)) { 
      return index; 
    } 
    String newValue = StringUtils.trim(value).toUpperCase(); 
    try { 
      index = valueOf(newValue).ordinal(); 
    } catch (IllegalArgumentException e) {} 
    return index; 
  } 
} 

3.PageUtil.java

/** 
 * 分頁(yè)工具類 
 * @author FENGWEI 
 * @date 2016-5-23 
 */ 
public class PageUtil { 
   
  public static final String ASC = "asc"; 
  public static final String DESC = "desc"; 
  public static final String PAGE_DESC = "↓"; 
  public static final String PAGE_ASC = "↑"; 
  public static final String PAGE_NULL = " ";  
  public static final String SESSION_PAGE_KEY = "page";   
   
   
  /** 
   * 初始化分頁(yè)類 
   * @param initPageSql 未分頁(yè)的查詢SQL 
   * @param totalCount  總行數(shù) 
   * @param index    分頁(yè)狀態(tài) 
   * @param value    只有在設(shè)置每頁(yè)顯示多少條時(shí),值不會(huì)NULL,其它為NULL 
   */ 
  public static Page inintPage(Long totalCount,Integer index,String value,Page sessionPage){  
    Page page = null; 
    if(index < 0){ 
       page = new Page(totalCount); 
    }else{ 
       /**每頁(yè)顯示多少條*/ 
       Long everPage = null == value ? 10 : Long.parseLong(value); 
       /**獲取Session中的分頁(yè)類,方便保存頁(yè)面分頁(yè)狀態(tài)*/ 
       page = sessionPage;        
       page.setEveryPage(everPage); 
       page.setTotalCount(totalCount);       
    }   
    return page;     
  } 
   
   
 
   
  /** 
   * 當(dāng)頁(yè)點(diǎn)擊:首頁(yè),前一頁(yè),后一頁(yè),末頁(yè),排序,到第多少頁(yè)時(shí)進(jìn)行分頁(yè)操作 
   * @param index 分頁(yè)狀態(tài) 
   * @param value 排序字段名或者到第多少頁(yè) 
   */ 
  public static Page execPage(int index,String value,Page sessionPage){  
    Page page = sessionPage;       
    /**調(diào)用方法進(jìn)行分頁(yè)計(jì)算*/ 
    page.pageState(index,value);     
    return page;     
  } 
 
} 

4.DefaultController.java  此部分可以靈活使用

package com.cm.contract.common; 
 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 
import javax.servlet.http.HttpSession; 
 
import org.springframework.web.bind.annotation.ModelAttribute; 
 
/** 
 * 提取公用的request和response Title:DefaultController Descrption: 
 * 
 * @author FENGWEI 
 * @date 2016-5-6下午3:30:32 
 */ 
public class DefaultController { 
 
  /** 
   * oracel的三層分頁(yè)語(yǔ)句 子類在展現(xiàn)數(shù)據(jù)前,進(jìn)行分頁(yè)計(jì)算! 
   * 
   * @param querySql 
   *      查詢的SQL語(yǔ)句,未進(jìn)行分頁(yè) 
   * @param totalCount 
   *      根據(jù)查詢SQL獲取的總條數(shù) 
   * @param columnNameDescOrAsc 
   *      列名+排序方式 : ID DESC or ASC 
   */ 
  protected Page executePage(HttpServletRequest request, Long totalCount) { 
    if (null == totalCount) { 
      totalCount = 0L; 
    } 
    /** 頁(yè)面狀態(tài),這個(gè)狀態(tài)是分頁(yè)自帶的,與業(yè)務(wù)無(wú)關(guān) */ 
    String pageAction = request.getParameter("pageAction"); 
    String value = request.getParameter("pageKey"); 
 
    /** 獲取下標(biāo)判斷分頁(yè)狀態(tài) */ 
    int index = PageState.getOrdinal(pageAction); 
 
    Page page = null; 
    /** 
     * index < 1 只有二種狀態(tài) 1 當(dāng)首次調(diào)用時(shí),分頁(yè)狀態(tài)類中沒(méi)有值為 NULL 返回 -1 2 當(dāng)頁(yè)面設(shè)置每頁(yè)顯示多少條: 
     * index=0,當(dāng)每頁(yè)顯示多少條時(shí),分頁(yè)類要重新計(jì)算 
     * */ 
    Page sessionPage = getPage(request); 
 
    if (index < 1) { 
      page = PageUtil.inintPage(totalCount, index, value, sessionPage); 
    } else { 
      page = PageUtil.execPage(index, value, sessionPage); 
    } 
    setSession(request, page); 
    return page; 
  } 
 
  private Page getPage(HttpServletRequest request) { 
    Page page = (Page) request.getSession().getAttribute( 
        PageUtil.SESSION_PAGE_KEY); 
    if (page == null) { 
      page = new Page(); 
    } 
    return page; 
  } 
 
  private void setSession(HttpServletRequest request, Page page) { 
    request.getSession().setAttribute(PageUtil.SESSION_PAGE_KEY, page); 
  } 
} 

使用方法:

5,Controller.java

/** 
   * model 添加的分頁(yè)條件 
   * executePage 方法寫(xiě)在工具類中 
   * @param model 
   */ 
@Controller 
public class CMLogController extends DefaultController { 
@RequestMapping("index.do") 
  public ModelAndView userInto(ModelMap model, String username) { 
    nameStr = username; 
    model.addAttribute("username", nameStr); 
    // 分頁(yè)數(shù) 
    Long totalCount = logService.pageCounts(model); 
    // 分頁(yè)顯示 
    Page page = executePage(request, totalCount); 
    if (page.isSort()) { 
      model.put("orderName", page.getSortName()); 
      model.put("descAsc", page.getSortState()); 
    } else { 
      model.put("orderName", "logtime"); 
      model.put("descAsc", "desc"); 
    } 
    model.put("startIndex", page.getBeginIndex()); 
    model.put("endIndex", page.getEndinIndex()); 
    ModelAndView mv = new ModelAndView(); 
    // 分頁(yè)查詢 
    logList = logService.pageList(model); 
    mv.addObject("logList", logList); 
    mv.setViewName("/jsp/log"); 
    return mv; 
  }} 

6.maybatis中幾條查詢語(yǔ)句

//分頁(yè)查詢 
<select id="pageList" parameterType="map" resultMap="BaseResultMap">   
     
    select ttt.* from(select tt.*,rownum rn from(select * from CM_LOG 
    <where>      
      <if test="username != null and username != ''"> 
        <!--  
         特別提醒一下, $只是字符串拼接, 所以要特別小心sql注入問(wèn)題。 
         在開(kāi)發(fā)時(shí)使用: $,方便調(diào)試sql,發(fā)布時(shí)使用: # 
        --> 
        and username like '%${username}%'           
      </if> 
       <if test="type != null and type != ''"> 
        <!--  
         特別提醒一下, $只是字符串拼接, 所以要特別小心sql注入問(wèn)題。 
         在開(kāi)發(fā)時(shí)使用: $,方便調(diào)試sql,發(fā)布時(shí)使用: # 
        --> 
        AND TYPE = #{type,jdbcType=VARCHAR}    
      </if> 
     </where>  
     order by ${orderName} ${descAsc} )tt)ttt 
     <where>  
      <if test="startIndex != null and startIndex != ''"> 
        rn > ${startIndex}           
      </if>  
      <if test="endIndex != null and endIndex != ''">        
         <![CDATA[ and rn <= ${endIndex} ]]>                
      </if>   
     </where>      
</select> 
// 分頁(yè)數(shù) 
 <select id="pageCounts" parameterType="map" resultType="long">   
  select count(*) from CM_LOG  
  <where>  
  <if test="username != null and username != ''"> 
    and username like '%${username}%'          
  </if>  
  </where>  
</select> 

7.前臺(tái)頁(yè)面index.jsp

//只需在頁(yè)面布局添加該div 
  //username 為條件  
  // <jsp:param name="url" value="/log/index.do?"/>    不帶條件的方式 問(wèn)號(hào)必須存在 
<body > 
  <div align="right" style="height: 20"> 
      <jsp:include page="/jsp/page.jsp"> 
          <jsp:param name="url" value="/log/index.do?username=${username }"/>     
 
        </jsp:include> 
    </div> 
 
    </body > 

8,引用的Page.jsp

  <%@ page language="java" contentType="text/html; charset=UTF-8" 
  pageEncoding="UTF-8"%> 
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 
<c:set var="page" value="${sessionScope.page}" /> 
<c:set var="path" value="${pageContext.request.contextPath}" /> 
<c:set var="url" value="${param.url}" /> 
<c:set var="urlParams" value="${param.urlParams}" /> 
<c:set var="pathurl" value="${path}/${url}" /> 
<tr> 
  <td colspan="5"> 
  ${urlParams } 
    共${page.totalCount}條記錄 共${page.totalPage}頁(yè) 每頁(yè)顯示${page.everyPage}條 
    當(dāng)前第${page.currentPage}頁(yè)  
    <c:choose> 
      <c:when test="${page.hasPrePage eq false}"> 
        <<首頁(yè) <上頁(yè)  
      </c:when> 
      <c:otherwise> 
        <a href="${pathurl}&pageAction=first${urlParams}"><<首頁(yè) </a>  
        <a href="${pathurl}&pageAction=previous${urlParams}" /><上一頁(yè)</a> 
      </c:otherwise> 
    </c:choose> 
     ||  
    <c:choose> 
      <c:when test="${page.hasNextPage eq false}"> 
         下頁(yè)> 尾頁(yè)>> 
      </c:when> 
      <c:otherwise> 
        <a href="${pathurl}&pageAction=next${urlParams}">下一頁(yè)> </a>  
        <a href="${pathurl}&pageAction=last${urlParams}">末頁(yè)>></a> 
      </c:otherwise> 
    </c:choose> 
      
    <SELECT name="indexChange" id="indexChange" 
      onchange="getCurrentPage(this.value);"> 
      <c:forEach var="index" begin="1" end="${page.totalPage}" step="1"> 
        <option value="${index}" ${page.currentPage eq index ? "selected" : ""}> 
          第${index}頁(yè) 
        </option> 
      </c:forEach> 
    </SELECT> 
      
    每頁(yè)顯示:<select name="everyPage" id="everyPage" onchange="setEveryPage(this.value);"> 
          <c:forEach var="pageCount" begin="5" end="${page.totalCount}" step="5">             
            <option value="${pageCount}" ${page.everyPage eq pageCount ? "selected" : ""}> 
              ${pageCount}條 
            </option> 
          </c:forEach> 
        </select> 
  </td> 
</tr> 
<div style='display: none'> 
  <a class=listlink id="indexPageHref" href='#'></a> 
</div> 
<script> 
function getCurrentPage(index){  
  var a = document.getElementById("indexPageHref");   
  a.href = '${pathurl}&pageAction=gopage&pageKey='+index+'${urlParams}';     
  a.setAttribute("onclick",'');      
  a.click("return false");   
} 
function setEveryPage(everyPage){   
  var a = document.getElementById("indexPageHref"); 
  var currentPage = document.getElementById('indexChange').value; 
  a.href = '${pathurl}&pageAction=setpage&pageKey='+everyPage+'${urlParams}';     
  a.setAttribute("onclick",'');      
  a.click("return false");   
} 
function sortPage(sortName){   
  var a = document.getElementById("indexPageHref");   
  a.href = '${pathurl}&pageAction=sort&pageKey='+sortName+'${urlParams}';    
  a.setAttribute("onclick",'');    
  a.click("return false");   
} 
</script> 

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • JAVA位運(yùn)算的知識(shí)點(diǎn)總結(jié)

    JAVA位運(yùn)算的知識(shí)點(diǎn)總結(jié)

    在本篇文章里小編給大家整理的是關(guān)于JAVA有關(guān)位運(yùn)算的全套梳理,需要的朋友們可以參考學(xué)習(xí)下。
    2020-03-03
  • SpringBoot項(xiàng)目接收前端參數(shù)的11種方式

    SpringBoot項(xiàng)目接收前端參數(shù)的11種方式

    在前后端項(xiàng)目交互中,前端傳遞的數(shù)據(jù)可以通過(guò)HTTP請(qǐng)求發(fā)送到后端, 后端在Spring Boot中如何接收各種復(fù)雜的前端數(shù)據(jù)呢?這篇文章總結(jié)了11種在Spring Boot中接收前端數(shù)據(jù)的方式,需要的朋友可以參考下
    2024-12-12
  • Spring中配置Transaction與不配置的區(qū)別及說(shuō)明

    Spring中配置Transaction與不配置的區(qū)別及說(shuō)明

    這篇文章主要介紹了Spring中配置Transaction與不配置的區(qū)別及說(shuō)明,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2024-07-07
  • SpringBoot獲取maven打包時(shí)間的兩種方式

    SpringBoot獲取maven打包時(shí)間的兩種方式

    這篇文章主要介紹了SpringBoot獲取maven打包時(shí)間的兩種方式,文章通過(guò)代碼示例給大家講解的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作有一定的幫助,需要的朋友可以參考下
    2024-05-05
  • springboot項(xiàng)目不輸出nohup.out日志的解決

    springboot項(xiàng)目不輸出nohup.out日志的解決

    這篇文章主要介紹了springboot項(xiàng)目不輸出nohup.out日志的解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2021-07-07
  • 解決idea中maven項(xiàng)目無(wú)端顯示404錯(cuò)誤的方法

    解決idea中maven項(xiàng)目無(wú)端顯示404錯(cuò)誤的方法

    這篇文章主要介紹了解決idea中maven項(xiàng)目無(wú)端顯示404錯(cuò)誤的方法,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-12-12
  • SpringBoot?MDC全局鏈路最新完美解決方案

    SpringBoot?MDC全局鏈路最新完美解決方案

    MDC 在 Spring Boot 中的作用是為日志事件提供上下文信息,并將其與特定的請(qǐng)求、線程或操作關(guān)聯(lián)起來(lái),通過(guò)使用 MDC,可以更好地理解和分析日志,并在多線程環(huán)境中確保日志的準(zhǔn)確性和一致性,這篇文章主要介紹了SpringBoot?MDC全局鏈路解決方案,需要的朋友可以參考下
    2023-08-08
  • Java使用字節(jié)流實(shí)現(xiàn)圖片音頻的復(fù)制

    Java使用字節(jié)流實(shí)現(xiàn)圖片音頻的復(fù)制

    今天帶大家學(xué)習(xí)Java的相關(guān)知識(shí),文章圍繞著Java如何使用字節(jié)流實(shí)現(xiàn)圖片音頻的復(fù)制展開(kāi),文中有非常詳細(xì)的介紹,需要的朋友可以參考下
    2021-06-06
  • Java?Agent探針技術(shù)詳解示例

    Java?Agent探針技術(shù)詳解示例

    這篇文章主要介紹了Java?Agent?探針技術(shù)詳情,Java?中的?Agent?技術(shù)可以讓我們無(wú)侵入性的去進(jìn)行代理,最常用于程序調(diào)試、熱部署、性能診斷分析等場(chǎng)景,下文更多相關(guān)資料,感興趣的小伙伴可以參考一下
    2022-06-06
  • Spring?Boot自定義Starter組件開(kāi)發(fā)實(shí)現(xiàn)配置過(guò)程

    Spring?Boot自定義Starter組件開(kāi)發(fā)實(shí)現(xiàn)配置過(guò)程

    SpringBoot中的starter是一種非常重要的機(jī)制,能夠拋棄以前繁雜的配置,將其統(tǒng)一集成進(jìn)?starter,應(yīng)用者只需要在maven中引入starter依賴,這篇文章主要介紹了Spring?Boot自定義Starter組件開(kāi)發(fā)實(shí)現(xiàn),需要的朋友可以參考下
    2022-06-06

最新評(píng)論

邵阳市| 汾西县| 宜良县| 合作市| 枣阳市| 赤城县| 邵阳县| 肥乡县| 平邑县| 阿瓦提县| 于都县| 广西| 湖南省| 腾冲县| 于都县| 齐齐哈尔市| 江山市| 昂仁县| 浑源县| 利辛县| 江门市| 西林县| 巴中市| 千阳县| 定结县| 仪陇县| 公安县| 商丘市| 铁岭县| 灵石县| 阿克陶县| 定西市| 从江县| 大荔县| 广丰县| 潜山县| 固安县| 佛学| 丘北县| 遂川县| 南雄市|