Passing parameters from JSP to Controller in Spring MVC

前端 未结 2 725
情深已故
情深已故 2020-12-03 11:28

I am trying out a sample project using Spring MVC annotated Controllers. All the examples I have found online so far bind the JSP to a particular model and the controller us

2条回答
  •  北海茫月
    2020-12-03 12:20

    If one doesn't want to create another class (bean) though it should be there, then apart from @ModelAttrbute one can also use @RequestParam.

    public String someAction(@RequestParam("somedata") String data)
    {
    ------
    }
    

提交回复
热议问题