Action中参数传递实用方法 Map session

来源:互联网 发布:js脚本 调用 c dll 编辑:程序博客网 时间:2024/06/07 06:07

 

 

 //如果一个action要用到另外一个action中的参数,可以先通过对象关系映射组件中的session功能:


import java.util.Map;

         ActionContextactionContext =    ActionContext.getContext();

         Map session = actionContext.getSession();

         session.put("USERID", userId);

         session.put("USERPWD", userPWD);

         session.put("PURVIEW", purview);

 

//把参数值存起来,然后在另一个action中通过


          ActionContextactionContext = ActionContext.getContext();

         Map session = actionContext.getSession();

         userId = (String) session.get("USERID");

         userPWD = (String) session.get("USERPWD");

         purview = (String)session.get("PURVIEW");


来获取。

原创粉丝点击