How can I handle url webix sorting and filter like this :
myhost.com/film?page=1&sort[title]=asc&filter[title]=cat&filter[year]=1998
in spring mvc
@RequestMapping(value = "/film", method = RequestMethod.GET)
public List<Phone> listFilm(
@RequestParam(value = "page", required = false) Integer page,
@RequestParam(value = "sort", required = false) String sort ) {
int page = (page != null) ? page : 0;
return filmService.getAll(page, sort);
}
is other way to get requestparams sort[title]=asc (with squarebracket in params) ? similar like this
I try in PHP work fine to get params with bracket
$sortArr = array();
if (isset($_GET["sort"])){ // get param sort[title]=asc
foreach($_GET["sort"] as $name => $dir){
array_push($sortArr,$db->escapeString($name)." ".$dir);
}
if(count($sortArr))
$str .= " ORDER BY ".implode(",",$sortArr);
}
Thanks any help/references I appreciate to solve this.