怎么样用el表达式获得保存在session中的hashmap的值(根据hashmap的键)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了怎么样用el表达式获得保存在session中的hashmap的值(根据hashmap的键)相关的知识,希望对你有一定的参考价值。

参考技术A $session.key 参考技术B <input type="button" value="$key"/> 参考技术C $session.hashmapName.key 参考技术D 打酱油的

ssh登录后,怎么获得SESSION中的东西?在action中怎么写?

参考技术A

1.你是把值放到request中了,必须每次请求都带着request里面的值,他才会一直有用。

所以你在showAPerson可能获取不到用户名

2.存入session,方法如下

//获取session

Map  session = ActionContext.getContext().getSession();

//加入session值

session.put("key", "value");

3.获取用户名

//获取session

Map  session = ActionContext.getContext().getSession();

//加入session值

session.get("key")。

以上是关于怎么样用el表达式获得保存在session中的hashmap的值(根据hashmap的键)的主要内容,如果未能解决你的问题,请参考以下文章