stringBuilder.append("&nbsp;<a href=\"").append(request.getContextPath()).append(getUrl()).append("&").append(getPageNumberAttributeName()).append("=").append(Integer.toString(i)).append("\">");
stringBuilder.append("&nbsp;<a href=\"").append(request.getContextPath()).append(getUrl()).append("&amp;").append(getPageNumberAttributeName()).append("=").append(Integer.toString(i)).append("\">");
    private void generatePageNumbers(StringBuilder stringBuilder, HttpServletRequest request, final int lastPage, final int pageNumber) {		int firstVisualizedPage = 1;	int lastVisualizedPage = lastPage;	Integer numberOfVisualizedPages = (getNumberOfVisualizedPages() != null) ? Integer.valueOf(getNumberOfVisualizedPages()) : null;		if(lastPage > 0 && numberOfVisualizedPages != null && numberOfVisualizedPages.intValue() > 0		&& lastPage > numberOfVisualizedPages.intValue()) {	    	    if(pageNumber == 1) {		lastVisualizedPage = numberOfVisualizedPages;			    	    } else if(pageNumber == lastPage) {		firstVisualizedPage = lastPage - (numberOfVisualizedPages - 1);			    	    	    } else {    	                   int numberOfLeftAndRightPages = (int)Math.floor((numberOfVisualizedPages - 1) / 2);	                    int leftPage = (pageNumber - numberOfLeftAndRightPages) <= 0 ? 1 : pageNumber - numberOfLeftAndRightPages;                int rightPage = numberOfLeftAndRightPages + pageNumber;	    	                                    firstVisualizedPage = (pageNumber != 1) ? (leftPage >= 1 ? leftPage : 1) : 1;                lastVisualizedPage = (pageNumber != lastPage) ? (rightPage <= lastPage ? rightPage : lastPage) : lastPage;                                int numberOfResultPages = Math.abs(firstVisualizedPage - lastVisualizedPage) + 1;                if(firstVisualizedPage == 1) {                    lastVisualizedPage = lastVisualizedPage + (numberOfVisualizedPages - numberOfResultPages);                } else if(lastVisualizedPage == lastPage) {                    firstVisualizedPage = firstVisualizedPage - (numberOfVisualizedPages - numberOfResultPages);                }                	    }	} 		for (int i = firstVisualizedPage; i <= lastVisualizedPage; i++) {	    	   	    if (i != pageNumber) {		stringBuilder.append("&nbsp;<a href=\"").append(request.getContextPath()).append(getUrl()).append("&").append(getPageNumberAttributeName()).append("=").append(Integer.toString(i)).append("\">");		stringBuilder.append(Integer.toString(i)).append("</a>&nbsp;");	   	    } else {		stringBuilder.append("&nbsp;<b>").append(Integer.toString(i)).append("</b>&nbsp;");	    }	    	   	}    }