0

I am setting a model attribute in controller like

@RequestMapping(value = {"/searchMessage.htm" }, method = RequestMethod.GET)
public String searchMessage(Model model, HttpServletRequest request) throws CoreException {

    if (request.getParameter("mode") != null)
        model.addAttribute("mode", "mode");

        return null;
} 

In My Java script i use the model attributes as

jQuery(document).ready(function() {
        var value = '${mode}';
});

Now i want to reset the model attribute called "mode" in my Js because it retains the value everytime the page is refreshed. Actually, i want to use the value only once during the first load of the page.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
SDC
  • 161
  • 1
  • 11

0 Answers0