jeudi 8 décembre 2016

Can't pass variables from URL to Spring matrix variable

I have a problem with passing variables form URL to Spring 4 @MatrixVariable.

Controller method:

@RequestMapping(value = "/filter/{ByCriteria}")
public String getProductsByFilter(@MatrixVariable(pathVar="ByCriteria") Map<String, String> filterParams, Model model) {
    Set<String> user = filterParams.keySet();
    if(user.contains("name") || user.contains("surname")) System.out.println("TRUE"); // nothing happens

    return "users";
}

Dispatcher-Servlet includes also:

<mvc:annotation-driven enable-matrix-variables="true"/>

I am using this URL: http://localhost:8080/webstore/filter/ByCriteria;name=Bob,surname=Fox

I have tried many combinations of URL links, method arguments but always the logical test is not true.




Aucun commentaire:

Enregistrer un commentaire