本文主要是介绍关于web.xml配置的小计,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<!-- Spring 刷新Introspector防止内存泄露 -->
<listener>
<listener-class>
org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener>
<!-- Spring 监听器 -->
<listener>
<display-name>Spring加载监听器</display-name>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!--多个spring文件加载 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/spring/applicationContext.xml,
/WEB-INF/spring/applicationContext-bbs.xml,
/WEB-INF/config/spring_newbbs.xml
</param-value>
</context-param>
<!--错误页配置 -->
<error-page>
<error-code>404</error-code>
<location>/error/404.jsp</location>
</error-page>
<error-page>
<error-code>400</error-code>
<location>/error/400.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error/500.jsp</location>
</error-page>
<error-page>
<error-code>503</error-code>
<location>/error/503.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/error/500.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.NullPointerException</exception-type>
<location>/error/500.jsp</location>
</error-page>
<!-- 设置session失效,单位分 -->
<session-config>
<session-timeout>20</session-timeout>
</session-config>
这篇关于关于web.xml配置的小计的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!