ie内核出现问题的解决方法
2011-03-21 23:44
302 查看
olinecount.jar 代码
加入was 类j2ee.jar 在放入portal share里面的ext 下面
package com.gzepro;
public class SessionCounter implements javax.servlet.http.HttpSessionListener
{
//定义静态变量保存在线人数
private static int activeSessions = 0;
public SessionCounter()
{
}
public void sessionCreated(javax.servlet.http.HttpSessionEvent arg0)
{ //如果会话创建则把在线人数加1
activeSessions++;
}
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent arg0)
{ //在会话被关闭的时候,如果在线人数大于0,则减1
if (activeSessions > 0)
activeSessions--;
}
//返回在线人数
public static int getActiveSessions()
{
return activeSessions;
}
}
在主题里部署监听器
操作之前要先备份目录wps.ear 防止删除skin them
导出wps.ear wsadmin.bat -user wpsadmin -password admin -c "$AdminApp export wps c:/wps.ear" 如果出错检查soap端口 -port 10033 这里如是系统是linux 的"$AdminApp export wps c:/wps.ear" " 改成 '
展出wps.ear EARExpander.bat -ear c:\wps.ear -operationDir c:\wps_expanded -operation expand
展入wps.ear EARExpander.bat -ear c:\wps.ear -operationDir c:\wps_expanded -operation collapse
导入wps.ear wsadmin.bat -user wpsadmin -password admin -port 10033 -c "$AdminApp install c:/wps.ear {-update -appname wps -nodeployejb}" 如果出错检查soap端口 -port 10033
them skin要重新布置
在web.xml文件中加入:
<listener>
<listener-class>
com.gzepro.SessionCounter
</listener-class>
</listener>
在页面的js当中加入
<script>
window.onbeforeunload = function()
{
if((event.clientX>document.body.clientWidth&&event.clientY<0)||event.altKey)
{
alert("close");
window.location.href="<portal-navigation:url command='LogoutUser'/>"; //关闭页面注销session
}
else
{
alert("refsh");
}
}
</script>
在jsp的页面里引入 import="com.gzepro.SessionCounter",再 加入<%= SessionCounter.getActiveSessions() %>即可,这里直接调用监听器的方法获得用户数。
参考资料:http://www.webspherechina.net/?492/viewspace-1108.html
oliverchan
wp 5.0在线统计 http://swcracker.itpub.net/post/28352/269976 swcracker的博客
加入was 类j2ee.jar 在放入portal share里面的ext 下面
package com.gzepro;
public class SessionCounter implements javax.servlet.http.HttpSessionListener
{
//定义静态变量保存在线人数
private static int activeSessions = 0;
public SessionCounter()
{
}
public void sessionCreated(javax.servlet.http.HttpSessionEvent arg0)
{ //如果会话创建则把在线人数加1
activeSessions++;
}
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent arg0)
{ //在会话被关闭的时候,如果在线人数大于0,则减1
if (activeSessions > 0)
activeSessions--;
}
//返回在线人数
public static int getActiveSessions()
{
return activeSessions;
}
}
在主题里部署监听器
操作之前要先备份目录wps.ear 防止删除skin them
导出wps.ear wsadmin.bat -user wpsadmin -password admin -c "$AdminApp export wps c:/wps.ear" 如果出错检查soap端口 -port 10033 这里如是系统是linux 的"$AdminApp export wps c:/wps.ear" " 改成 '
展出wps.ear EARExpander.bat -ear c:\wps.ear -operationDir c:\wps_expanded -operation expand
展入wps.ear EARExpander.bat -ear c:\wps.ear -operationDir c:\wps_expanded -operation collapse
导入wps.ear wsadmin.bat -user wpsadmin -password admin -port 10033 -c "$AdminApp install c:/wps.ear {-update -appname wps -nodeployejb}" 如果出错检查soap端口 -port 10033
them skin要重新布置
在web.xml文件中加入:
<listener>
<listener-class>
com.gzepro.SessionCounter
</listener-class>
</listener>
在页面的js当中加入
<script>
window.onbeforeunload = function()
{
if((event.clientX>document.body.clientWidth&&event.clientY<0)||event.altKey)
{
alert("close");
window.location.href="<portal-navigation:url command='LogoutUser'/>"; //关闭页面注销session
}
else
{
alert("refsh");
}
}
</script>
在jsp的页面里引入 import="com.gzepro.SessionCounter",再 加入<%= SessionCounter.getActiveSessions() %>即可,这里直接调用监听器的方法获得用户数。
参考资料:http://www.webspherechina.net/?492/viewspace-1108.html
oliverchan
wp 5.0在线统计 http://swcracker.itpub.net/post/28352/269976 swcracker的博客
相关文章推荐
- 关于IE出现问题的解决方法
- IE 下js里面new Date("2011-11-11") 出现nan的问题以及解决方法
- 在编写最简单的linux 内核驱动, 编译后出现的问题以及解决方法。
- IE 下js里面new Date("2017-07-11 08:00:00") 出现NAN的问题以及解决方法
- Linux2.6.0内核下make menuconfig时出现的问题及解决方法
- vs2008与IIS 7.0使用在vista上时出现的问题及解决方法(Internet Explorer 无法显示该页面)(VS2008: IE Cannot Display Web Page)
- uploadify在ie,chrome等浏览器上传文件成功,而firefox出现http error 404问题的解决方法
- ie下$.getJSON出现问题的解决方法
- 用IE删除软件删除IE出现问题解决方法
- ie下$.getJSON出现问题的解决方法
- mini2440内核编译的USB问题,出现usb 1-1: device descriptor read/64的解决方法
- 关于编译内核后出现start kernel...停止不动的问题及解决方法
- 关于IE中出现的内存不能为written问题的解决方法
- 双击桌面IE图标出现打开方式的问题的解决方法
- web 前台ie不兼容出现的问题及解决方法
- IE 下js里面new Date("2017-07-11 08:00:00") 出现NAN的问题以及解决方法
- 关于IE出现问题的解决方法
- IE9 table显示问题,td出现错位的解决方法
- Kettle数据抽取(转换)出现乱码问题解决方法
- ubuntu下出现的问题和解决方法