I'm trying to use GET parameters to alter the Model Attribute that's creates a table like object returned to the view. To be specific: I want to send the name of a column as a GET parameter and highlight that column by coloring it differently. My current setup looks like this:
private String highlightedCol;
@ModelAttribute("model")
public Model populateModel() {
Model model = new Model();
generateModel();
//Use Highlighted Col
return model;
}
@RequestMapping("/index")
public String getIndex(@RequestParam(value="ts", required = false, defaultValue="") String col) {
highlightedCol = col;
return "index";
}
I'm having trouble using the "col" parameter in the ModelAttribute because the ModelAttribute gets executed before the RequestMapping. How would i go about using the GET parameter for my Model?