Announcement Announcement Module
Collapse
No announcement yet.
Spring Data JPA - can't get request param "page" with PageableArgumentResolver Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data JPA - can't get request param "page" with PageableArgumentResolver

    Im using Spring Data JPA and I'm trying to use Pageable in my controllers but Pageable only retrieve "page.size"
    "page.sort", "page.sort.dir" request parameteres. I can't retrieve "page" parameter. I tried "page", "page.page", etc....

    My controller
    Code:
    @RequestMapping(value = "/clients/accounts/transactions/{indexAccount}", method = RequestMethod.GET)
    	public String setupForm(@PathVariable int indexAccount, @ModelAttribute Client client, Model model, @PageableDefaults(pageNumber=0, value= 2) Pageable pageable) {
    		this.account = client.getAccounts().get(indexAccount);
    		model.addAttribute("account", account);
    		Page<Movement> movements = transactionService.findByProductMovements(account, pageable);
    		
    		model.addAttribute("movements", movements);
    		
    				
    		return "clients/accounts/transactions";
    	}

    My jsp

    Code:
    <spring:url value="/clients/accounts/transactions" var="next">
    		<spring:param name="page" value="${movements.number + 1}"></spring:param>
    		<spring:param name="page.size" value="${movements.size}"></spring:param>
    	</spring:url>
    	<a href="${next}">Next</a>

    Thanks for your help
Working...
X