異常:頁(yè)面第一次切換成功,后面幾次失靈
原因:處理url時(shí)少了“url = ”導(dǎo)致url未處理茂浮,每次翻頁(yè)都在url后面添加個(gè)新的pageCode參數(shù)
private String getUrl(HttpServletRequest request) {
String url = request.getRequestURI() + "?" + request.getQueryString() ;
int index = url.lastIndexOf("&pageCode=") ;
if (index != -1) {
url = url.substring(0, index) ;
}
return url ;
}