高分请教高手!!!

Iknownothing 2002-01-17 12:39:21
我们的系统web server是resin.是用jsp+java、数据库为oracle开发的系统,现在存在session过期的问题。进入系统后,重编译servlet时session过期是对的。问题是不编译servlet时session也会过期,请问这和resin配置有什么关系。说明一下session的设置一切正确。
resin的配置如下:

<caucho.com>

<java compiler="internal" compiler-args="" work-dir='work'/>

<resource-ref>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<init-param driver-name="org.gjt.mm.mysql.Driver"/>
<init-param url="jdbD:mysql://localhost:3306/test"/>
<init-param user=""/>
<init-param password=""/>
<init-param max-connections="200"/>
<init-param enable-transaction="true"/>
</resource-ref>
<jsp precompile='true' static-encoding='true'/>

<http-server>
<app-dir>doc</app-dir>

<!-- the http port -->
<http port='8888'/>


<caucho-status>true</caucho-status>

<thread-max>150</thread-max>

<thread-keepalive id='100'/>
<request-timeout id='30s'/>
<cache dir='cache' size='1024' entries='1024'/>
<host id=''>

<error-log id='log/error.log'/>

<war-dir id='webapps'/>


<web-app id='/'>
<class-update-interval id='1'/>

<classpath id='WEB-INF/classes'
source='WEB-INF/classes'
compile='true'/>
<cache-mapping url-pattern='/' expires='2s'/>

<welcome-file-list>index.xtp, index.jsp, index.html</welcome-file-list>

<session-config>
<session-max>4096</session-max>
<session-timeout>10000</session-timeout>
<enable-cookies>true</enable-cookies>
<enable-url-rewriting>true</enable-url-rewriting>
<file-store>sessions</file-store>
</session-config>

<multipart-form/>

<servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>

<servlet-mapping url-pattern='*.xtp'
servlet-name='com.caucho.jsp.XtpServlet'/>
<servlet-mapping url-pattern='*.jsp'
servlet-name='com.caucho.jsp.JspServlet'/>
<context-param info='An application information string'/>

<servlet-mapping url-pattern='/snoop/*' servlet-name='snoop-servlet'/>

<servlet servlet-name='snoop-servlet' servlet-class='Env'>
<init-param info='A servlet information string'/>
</servlet>

<path-mapping url-regexp='^/~([^/]*)' real-path='/home/$1/public_html/'/>
</web-app>


<web-app id='/idealgmp' app-dir="D:\tyjideal\idealgmp\idealpages">

<classpath id='D:\tyjideal\idealgmp\classes' source='D:\tyjideal\idealgmp\classes' compile='true'/>
<cache-mapping url-pattern='/' expires='2s'/>

<welcome-file-list>index.xtp, index.jsp, index.html, index.htm</welcome-file-list>

<servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>

<servlet-mapping url-pattern='*.xtp' servlet-name='com.caucho.jsp.XtpServlet'/>

<servlet-mapping url-pattern='*.jsp' servlet-name='com.caucho.jsp.JspServlet'/>

<session-config>

<session-max>400</session-max>

<session-timeout>1000</session-timeout>

<enable-cookies>true</enable-cookies>

<enable-url-rewriting>true</enable-url-rewriting>

<cookie-version>0</cookie-version>

</session-config>

</web-app>
<web-app id='/finance' app-dir="D:\finance\pages">

<classpath id='D:\finance\classes' source='D:\finance\classes' compile='true'/>
<cache-mapping url-pattern='/' expires='2s'/>

<welcome-file-list>index.xtp, index.jsp, index.html, index.htm</welcome-file-list>

<servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>

<servlet-mapping url-pattern='*.xtp' servlet-name='com.caucho.jsp.XtpServlet'/>

<servlet-mapping url-pattern='*.jsp' servlet-name='com.caucho.jsp.JspServlet'/>

<session-config>

<session-max>4000</session-max>

<session-timeout>10000</session-timeout>

<enable-cookies>true</enable-cookies>

<enable-url-rewriting>true</enable-url-rewriting>

<cookie-version>0</cookie-version>

</session-config>

</web-app>
<web-app id='/idealga' app-dir="D:\gawork\pages">

<classpath id='D:\gawork\classes' source='D:\gawork\classes' compile='true'/>
<cache-mapping url-pattern='/' expires='2s'/>

<welcome-file-list>index.xtp, index.jsp, index.html, index.htm</welcome-file-list>

<servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>

<servlet-mapping url-pattern='*.xtp' servlet-name='com.caucho.jsp.XtpServlet'/>

<servlet-mapping url-pattern='*.jsp' servlet-name='com.caucho.jsp.JspServlet'/>

<session-config>

<session-max>4000</session-max>

<session-timeout>10000</session-timeout>

<enable-cookies>true</enable-cookies>

<enable-url-rewriting>true</enable-url-rewriting>

<cookie-version>0</cookie-version>

</session-config>

</web-app>

</host>


</http-server>
</caucho.com>
好象没问题啊?


...全文
215 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
Iknownothing 2002-01-18
  • 打赏
  • 举报
回复
我已经解决了,谢谢了 !
xmvigour 2002-01-17
  • 打赏
  • 举报
回复
session-timeout>10000</session-timeout>

是用来设置 session过期的期限!
Iknownothing 2002-01-17
  • 打赏
  • 举报
回复
xmvigour(微电),非常感谢你。你能和我通过QQ聊聊吗?我的QQ号是28566783
xmvigour 2002-01-17
  • 打赏
  • 举报
回复
既然这样先把
<session-timeout>10000</session-timeout>
设大点吧,至于要多大,我也不清楚,你就多试几次吧:))
Iknownothing 2002-01-17
  • 打赏
  • 举报
回复
可能可以优化,但是我有时速度还可以,也一样过期的啊
xmvigour 2002-01-17
  • 打赏
  • 举报
回复
没有关系,我是说你查询的sql能不能再优化,这样速度会加快的
Iknownothing 2002-01-17
  • 打赏
  • 举报
回复
请问session过期跟速度慢有关吗?
xmvigour 2002-01-17
  • 打赏
  • 举报
回复
自己试试看吧!
”我做一次查询,速度不是很快“从数据库的角度考虑,sql是不是可以再优化一下!
Iknownothing 2002-01-17
  • 打赏
  • 举报
回复
请问是不是<session-timeout>10000</session-timeout>中的数值越大越好。它的极限是多少。
Iknownothing 2002-01-17
  • 打赏
  • 举报
回复
我在登陆界面用了session.putValue(userCode,"globalUser")
外,在每次session.getValue(userCode,"globalUser")时,都做了一次
session.putValue(userCode,"globalUser");
这样没有什么问题的。
Iknownothing 2002-01-17
  • 打赏
  • 举报
回复
我做一次查询,速度不是很快,web系统速度问题避免不了的,就眼睁睁地看着userCode变成null了。
xmvigour 2002-01-17
  • 打赏
  • 举报
回复
看一下帮组,单位为什么?
还有是不是只有这个地方用到session.putValue(userCode,"globalUser");

还有没其它地方也用到了,查一下!
Iknownothing 2002-01-17
  • 打赏
  • 举报
回复
没有用啊。10000分钟已经很大了。
xmvigour 2002-01-17
  • 打赏
  • 举报
回复
你原来是
<session-timeout>10000</session-timeout>
每次把那个值加一点比如2倍,试试看那个值对你比较适用!
Iknownothing 2002-01-17
  • 打赏
  • 举报
回复
过期是这样的
按用户名、密码进入系统后,一会儿
用户名就取不到了。在登陆界面如下设置userCode变量:
session.putValue(userCode,"globalUser");
然后在每个表单中都调用这样一段代码以显示该用户菜单:
<%
String userCode=(String)session.getValue("gobalUser");
try{
iUserCode=Integer.valueOf(userCode).intValue();
out.print(Menu.showMenu("销售","black",iUserCode));//显示该用户能访问的菜单,iUserCode为条件
}
catch(Exception ex)
{
%>
<script language=vbscript>
document.location=../index.jsp
</script>
<%
}
%>
进入系统过后,userCode开始有值,过一会儿就变成null了或者一进去userCode就变成null了。只要打开速度慢了,userCode就变null了
Iknownothing 2002-01-17
  • 打赏
  • 举报
回复
对不起,是这样,打开一个页面的时间稍长就过期了。
xmvigour 2002-01-17
  • 打赏
  • 举报
回复
你要长的就设大一点,
还有为什么你的程序,session会过期,是不是那部分运行时间过长没响应?
Iknownothing 2002-01-17
  • 打赏
  • 举报
回复
请问应该设置多少?

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧