Example usage for javax.servlet.jsp JspWriter println

List of usage examples for javax.servlet.jsp JspWriter println

Introduction

In this page you can find the example usage for javax.servlet.jsp JspWriter println.

Prototype


abstract public void println() throws IOException;

Source Link

Document

Terminate the current line by writing the line separator string.

Usage

From source file:org.shredzone.cilla.web.renderer.PaginatorFragmentRenderer.java

@Fragment(name = "paginator")
public void paginatorFragment(PaginatorModel model, @FragmentValue("#filter") FilterModel filter, Locale locale,
        HttpServletResponse resp, JspWriter out) throws IOException {
    int selected = model.getSelectedPage();

    // Setup the PaginatorStrategy
    PaginatorRendererStrategy strategy = getPaginatorStrategy();
    strategy.setLocale(locale);/*from   w  w w .ja  v a2  s.co  m*/

    // Open the paginator container
    strategy.openContainer(out);

    // "previous" link
    if (model.isFirstPage()) {
        strategy.previousLink(out, null);
    } else {
        strategy.previousLink(out, getUrl(resp, filter, selected - 1));
    }

    // page links
    int current = 0, last;
    do {
        strategy.pageLink(out, getUrl(resp, filter, current), current, selected);
        last = current;
        current = strategy.computeNextPage(model, current);
    } while (current >= 0 && current != last);

    // "next" link
    if (model.isLastPage()) {
        strategy.nextLink(out, null);
    } else {
        strategy.nextLink(out, getUrl(resp, filter, selected + 1));
    }

    // Close the paginator container
    strategy.closeContainer(out);
    out.println();
}