action中在session中放置全局变量(变量为对象)

代码:ActionContext.getContext().getSession().put("**", **);

注意点:放置的若为对象则在对象实体类中需要序列化——>

              public class User implements java.io.Serializable {

               ...

              }

猜你喜欢

转载自blog.csdn.net/qq_42617840/article/details/81178342