白社会阳光牧场场的uid=(32位) 和 sessionid=(32位)怎么用手...

如何查看手机QQ家园阳光牧场制造屋的uid码和sessionid码?_百度知道随笔 - 172&
评论 - 16&
&&&&&&&&&&&
阅读(...) 评论()博客访问:
博文数量: 858
博客积分: 11684
博客等级: 上将
技术积分: 9175
注册时间:
IT168企业级官微
微信号:IT168qiye
系统架构师大会
微信号:SACC2013
分类: Java
每次用户登录虽然通过HttpSession获取的sessionId是不同的,这个时候要想实现单用户登录,也可以自己设计一个方法来做,但是我选择了拦截器,下面是我的拦截器代码
public&String&intercept(ActionInvocation&invocation)&throws&Exception&{ &&
&&&&&&&&HttpServletRequest&request&=&ServletActionContext.getRequest(); &&
&&&&&&&&HttpSession&session&=&request.getSession();&&&&& &&
&&&&&&&&String&hashcode=session.getId(); &&
&&&&&&&&Customer&customer&=(Customer)&invocation.getInvocationContext().getSession().get("customer"); &&
&&&&&&&& &&
&&&&&&&&if(customer!=null){ &&
&&&&&&&&&&&& &&
&&&&&&&&&&&&if(hashcode!=null){ &&
&&&&&&&&&&&&&&&&String&hashcodetemp=customer.getPointcode(); &&
&&&&&&&&&&&&&&&&if(hashcodetemp.equals(hashcode)){ &&
&&&&&&&&&&&&&&&&&&&&ThreadLocalUser.set(customer); &&
&&&&&&&&&&&&&&&&&&&&String&result&=&invocation.invoke(); &&
&&&&&&&&&&&&&&&&&&&&ThreadLocalUser.set(null); &&
&&&&&&&&&&&&&&&&&&&&loggedIn&=&true; &&
&&&&&&&&&&&&&&&&&&&&return& &&
&&&&&&&&&&&&&&&&} &&
&&&&&&&&&&&&&&&&ActionContext.getContext().getSession().clear(); &&
&&&&&&&&&&&&&&&&HttpServletRequest&req&=&ServletActionContext.getRequest(); &&
&&&&&&&&&&&&&&&&HttpSession&sessionnull&=&req.getSession(); &&
&&&&&&&&&&&&&&&&sessionnull.invalidate(); &&
&&&&&&&&&&&&&&&&ActionSupport&action&=&(ActionSupport)&invocation.getAction(); &&
&&&&&&&&&&&&&&&&action.addActionError("^o^你的账号已经在其它地方登录^o^"); &&
&&&&&&&&&&&&&&&&loggedIn&=&false; &&
&&&&&&&&&&&&&&&&return&Action.LOGIN; &&
&&&&&&&&&&&&} &&
&&&&&&&&&&&&ActionSupport&action&=&(ActionSupport)&invocation.getAction(); &&
&&&&&&&&&&&&action.addActionError("^o^你的账号已经在其它地方登录^o^"); &&
&&&&&&&&&&&&loggedIn&=&false; &&
&&&&&&&&&&&&return&Action.LOGIN;&&&&&&&&&&&&&&&& &&
&&&&&&&&} &&
&&&&loggedIn&=&false; &&
&&&&return&Action.LOGIN; &&
}&& public String intercept(ActionInvocation invocation) throws Exception {
HttpServletRequest request = ServletActionContext.getRequest();
HttpSession session = request.getSession();
String hashcode=session.getId();
Customer customer =(Customer) invocation.getInvocationContext().getSession().get("customer");
if(customer!=null){
if(hashcode!=null){
String hashcodetemp=customer.getPointcode();
if(hashcodetemp.equals(hashcode)){
ThreadLocalUser.set(customer);
String result = invocation.invoke();
ThreadLocalUser.set(null);
loggedIn =
ActionContext.getContext().getSession().clear();
HttpServletRequest req = ServletActionContext.getRequest();
HttpSession sessionnull = req.getSession();
sessionnull.invalidate();
ActionSupport action = (ActionSupport) invocation.getAction();
action.addActionError("^o^你的账号已经在其它地方登录^o^");
loggedIn =
return Action.LOGIN;
ActionSupport action = (ActionSupport) invocation.getAction();
action.addActionError("^o^你的账号已经在其它地方登录^o^");
loggedIn =
return Action.LOGIN;
loggedIn =
return Action.LOGIN;
在调试的过程发现,每次获取的Customer对象中的postcode竟然是没有刷新的,而是从session获取的,虽然我已经在第二个用户强制登录后update了 postcode这个列,我也想了其它方法来check或者fetch这个customer对象,但是都是出现null指针问题,暂时想不出法子,有能帮忙解决的吗 谢谢了
阅读(10136) | 评论(0) | 转发(0) |
相关热门文章
给主人留下些什么吧!~~
请登录后评论。我今天抽空写一篇关于TinyJSON使用的文章吧。
&re: 【原创】阳光牧场外挂的主要编写思路介绍
能否实现这个功能:好友的某种果实成熟后,马上通知外挂去采摘?&&&&
&re: 【原创】阳光牧场外挂的主要编写思路介绍
0904版今天不能获取阳光牧场的页面了,每次重试三次后都不行。&&&&
&re: 【原创】阳光牧场外挂的主要编写思路介绍
老大能不能搞一个池塘边的外挂啊?&&&&
&校内网的阳光牧场外挂的主要编写思路是怎么样的?
校内网的阳光牧场外挂的主要编写思路是怎么样的?能介绍一下吗?谢谢!&&&&
&re: 【原创】阳光牧场外挂的主要编写思路介绍
最近看了下这篇文章很好,自己是新手,有很多地方不是太懂,而且开心网花园玩的人是最多的了,如果哪位朋友能从头分析教大家作作外挂就最好了,希望中~&&&&
&re: 【原创】阳光牧场外挂的主要编写思路介绍
自己平时比较喜欢编程,,想学学编外挂,,能不能把阳光牧场外挂的封包前的文件发给我学习一下,这个外挂确实不错。可以的话发到我的邮箱谢谢。或者我的qq,&&&&
&re: 【原创】阳光牧场外挂的主要编写思路介绍
能不能把阳光牧场外挂的封包前的文件发给我学习一下,这个外挂确实不错。可以的话发到我的邮箱谢谢&&&&
&re: 【原创】阳光牧场外挂的主要编写思路介绍[未登录]
@blgzs QQ脑残呀!这涉及到浏览器的兼容性的问题,以及,现在不少浏览器引擎都是开源的!!!加密可以解密!!!&&&&
&re: 【原创】阳光牧场外挂的主要编写思路介绍
我的神呀 现在不能用了 请再次施展法术吧&&&&
&re: 【原创】阳光牧场外挂的主要编写思路介绍[未登录]
你的文章都写得挺好的,我的网站&&&&
282930123456789101112131415161718202122232425262829303112345678
评论 - 588
留言簿(75)
阅读排行榜
评论排行榜}

我要回帖

更多关于 51阳光牧场 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信