Spring mvc 在Spring MVC的资源阶段设置模型属性

Spring mvc 在Spring MVC的资源阶段设置模型属性,spring-mvc,modelattribute,Spring Mvc,Modelattribute,我需要更新资源方法中的模型属性。问题是,在更新它之后,我需要在模型中设置这个新修改的bean,以便在调用某个操作方法时获得正确的时间戳来执行下一个操作 我有我的豆子 @SessionAttributes(ServletContextKeys.MY_BEAN) 及 @ModelAttribute(ServletContextKeys.MY_BEAN) anotations,所以我从resource方法中的会话中获取bean,但是在更新它之后,我不知道如何在resource阶段访问模型,或者任何其他

我需要更新资源方法中的模型属性。问题是,在更新它之后,我需要在模型中设置这个新修改的bean,以便在调用某个操作方法时获得正确的时间戳来执行下一个操作

我有我的豆子 @SessionAttributes(ServletContextKeys.MY_BEAN) 及 @ModelAttribute(ServletContextKeys.MY_BEAN) anotations,所以我从resource方法中的会话中获取bean,但是在更新它之后,我不知道如何在resource阶段访问模型,或者任何其他可能的工作区来解决这个问题

 @ResourceMapping(ServletContextKeys.MY_RESOURCE_METHOD)
 public final void updateDoc(){
    MyBean myBean = getBeanFromSession();
    MyBean myNewBean = myService.updateDocs(myBean); //This mehod will change the timestamp and return the updated bean

    //Now I'd like to set the bean in the model. How could I access it?
    model.addAttribute(ServletContextKeys.MY_BEAN, myNewBean);
    }

到目前为止,我还没有找到解决这个问题的正确方法,所以我不得不使用会话来获取新的bean。