将 bean 从操作映射到 struts2 中的表单

Mapping bean from action to a form in struts2

我使用 ModelDriven 将参数从表单 (value=username, fullname,...) 填充到 Action 中的一个 bean(一个名为 user 的 bean)。 我怎样才能从动作到表格做同样的事情(视图仍然 value=username, fullname,... 而不是 user.username, user.fullname, ...

等了几天,找到了2个方法:

 1. set refreshModelBeforeResult param of ModelDriven interceptor to true

 2. ActionContext.getContext().getActionInvocation().getStack().push(user);