How to handle RequestParam with bracket in Spring MVC -
how can handle url webix sorting , filter :
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 requestparams sort[title]=asc (with squarebracket in params) ? similar this
i try in php work fine params bracket
$sortarr = array(); if (isset($_get["sort"])){ // param sort[title]=asc foreach($_get["sort"] $name => $dir){ array_push($sortarr,$db->escapestring($name)." ".$dir); } if(count($sortarr)) $str .= " order ".implode(",",$sortarr); }
thanks help/references appreciate solve this.
Comments
Post a Comment