How to pass model attributes from one Spring MVC controller to another controller?

后端 未结 10 1346
暗喜
暗喜 2020-11-27 13:19

I am redirecting from a controller to another controller. But I also need to pass model attributes to the second controller.

I don\'t want to put the model in sessi

10条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-27 14:09

    Maybe you could do it like this:

    Don't use the model in first controller. Store data in some other shared object which could be then retrieved by second controller.

    Look at this and this post. It's about the similar issue.

    P.S.

    You could probabbly use session scoped bean for that shared data...

提交回复
热议问题