Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

Access page.hasPreviousPage() in using Spring EL in a Web page?

$
0
0
org.springframework.data.domain.Page has two methods which would be useful for creating a paginator component in a Web page: hasPreviousPage() and hasNextPage().

However, if I am using Thymeleaf, and I configure the template engine as follows:

Code:

@Bean
public SpringTemplateEngine templateEngine() {
        SpringTemplateEngine engine = new SpringTemplateEngine();
        engine.setTemplateResolver(templateResolver());
        return engine;
}

I have so far failed to find a valid expression to access either method in a Web page. None of the following work:

${page.previousPage}
${page.hasPreviousPage}
${page.hasPreviousPage()}


What is the right way to do this in an expression, if any, using these two methods? (Yes, I know, I can write th:if="${not page.firstPage}" ... I'm doing that right now, while waiting for a reply.)

Viewing all articles
Browse latest Browse all 297

Trending Articles