model.addattribute()的作用

560 阅读1分钟

往前台传数据,可以传对象,可以传List,通过el表达式 ${}可以获取到,

类似于request.setAttribute("sts",sts)效果一样。
model.addattribute():

前端调用: