博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助 

天堂あ飞翔

Things do not change; we change...
heavenflying.cublog.cn
关于作者  
     ^V^^V^^V^^V^^V^^V^
     LOVE MY GF FOREVER
     ^V^^V^^V^^V^^V^^V^

我的分类  




How to set the timeout in the web application?

I have tried several methods to modify the value of the timeout for my current project. I find modify the web configuration file (web.xml) is the easiest way to implement it.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app 
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" 
    "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
    <display-name>
      The name of the application 
    </display-name>
    <description>
      C'mon, you know what goes into a description, don't you?
    </description>
    <context-param>
      <param-name>name_of_context_initialization_parameter</param-name>
      <param-value>value_of_context_initializtion_parameter</param-value>
      <description> Again, some description </description>
    </context-param>
    <servlet>
      <servlet-name>guess_what_name_of_servlet</servlet-name>
      <description>Again, some description</description>
      <servlet-class>com.foo-bar.somepackage.TheServlet</servlet-class>
      <init-param>
        <param-name>foo</param-name>
        <param-value>bar</param-value>
      </init-param>
    </servlet>
    <servlet-mapping>
      <servlet-name>name_of_a_servlet</servlet-name>
      <url-pattern>*.some_pattern</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
      <servlet-name>image</servlet-name>
      <url-pattern>/image</url-pattern>
    </servlet-mapping>
    <session-config>
      <session-timeout>30</session-timeout> 
    </session-config>
</web-app>

session-timeout

<session-timeout>: The timeout for a session in minutes. If you want to modify the default timeout value, do it here.

 

In another way, you can use the JavaScript function window.setTimeout(…) to set the timeout value and do what you want it to do when the page is overtime.

 发表于: 2007-12-11,修改于: 2007-12-11 12:22
 已浏览592次,有评论0条
推荐 投诉

  网友评论

  发表评论



Copyright © 2001-2006 ChinaUnix.net All Rights Reserved

感谢所有关心和支持过ChinaUnix的朋友们
页面生成时间:2.15134

京ICP证041476号