`

Web.xml SSH+错误页面+超时时间、、配置

阅读更多
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
	http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>

	<!--
		Spring ApplicationContext配置文件的路径,可使用通配符,多个路径用,号分隔 此参数用于后面的Spring
		Context Loader
	-->
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>
			classpath:applicationContext.xml
		</param-value>
	</context-param>

	<!-- Filter 定义  -->
	<!-- Character Encoding filter -->
	<filter>
		<filter-name>encodingFilter</filter-name>
		<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
		<init-param>
			<param-name>encoding</param-name>
			<param-value>UTF-8</param-value>
		</init-param>
		<init-param>
			<param-name>forceEncoding</param-name>
			<param-value>true</param-value>
		</init-param>
	</filter>

	<!-- Struts2 filter -->
	<filter>
		<filter-name>struts2CleanupFilter</filter-name>
		<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
	</filter>

	<filter>
		<filter-name>struts2Filter</filter-name>
		<filter-class>
			org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
	</filter>

	<!-- display tag 配置的过滤器 -->
	<filter>
		<filter-name>exportFilter</filter-name>
		<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
	</filter>

	<!-- Filter 映射 -->
	<filter-mapping>
		<filter-name>encodingFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<filter-mapping>
		<filter-name>struts2CleanupFilter</filter-name>
		<url-pattern>*.action</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>

	<filter-mapping>
		<filter-name>struts2Filter</filter-name>
		<url-pattern>*.action</url-pattern>
		<dispatcher>REQUEST</dispatcher>
		<dispatcher>FORWARD</dispatcher>
	</filter-mapping>

	<!--Spring的ApplicationContext 载入 -->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<!-- Spring 刷新Introspector防止内存泄露 -->
	<listener>
		<listener-class>
			org.springframework.web.util.IntrospectorCleanupListener</listener-class>
	</listener>

	<!--
		监听器配置,java监听器,登陆监听session,Listener <listener>
		<listener-class>com.idcorner.action.listener.LoginListener</listener-class>
		</listener>
	-->

	<!-- session超时定义,单位为分钟 -->
	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>

	<!--
		配置错误显示页面 <error-page> <error-code>404</error-code>
		<location>/404.jsp</location> </error-page> <error-page>
		<error-code>500</error-code> <location>/404.jsp</location>
		</error-page>
	-->

	<!-- 配置添加标签说明  -->
	<jsp-config>
		<taglib>
			<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
			<taglib-location>/WEB-INF/c.tld</taglib-location>
		</taglib>
		<!--
			<taglib> <taglib-uri>http://displaytag.sourceforge.net/</taglib-uri>
			<taglib-location>/WEB-INF/displaytag-11.tld</taglib-location>
			</taglib>
		-->
		<taglib>
			<taglib-uri>http://displaytag.sf.net</taglib-uri>
			<taglib-location>/WEB-INF/displaytag.tld</taglib-location>
		</taglib>
	</jsp-config>

	<mime-mapping>
		<extension>css</extension>
		<mime-type>text/css</mime-type>
	</mime-mapping>
</web-app>
分享到:
评论

相关推荐

    struts.xml和applicationContext.xml、web.xml的配置

    在Java Web开发中,`struts.xml`, `applicationContext.xml` 和 `web.xml` 是三个至关重要的配置文件,它们各自负责不同的职责,并协同工作来构建一个完整的应用框架。以下是关于这三个配置文件的详细说明。 首先,...

    SSH框架配置文件及web.xml jar包

    在这个文件中,可以配置过滤器、监听器、Servlet、Session超时、错误页面等。在SSH框架中,web.xml通常用于注册DispatcherServlet(Spring MVC的前端控制器)、Filter(如Struts2的FilterDispatcher)以及Spring的...

    web SSH XML 文件

    Web SSH XML 文件是一种在Web应用程序中使用SSH(Secure Shell)服务时所涉及的配置文件,主要以XML(Extensible Markup Language)格式存储。对于初学者来说,这些文件提供了理解和实践SSH连接、安全通信以及Web...

    ssh+security实现权限管理

    - Spring Security的配置类或XML配置文件,定义了权限控制规则、认证源和访问决策策略。 综上所述,"ssh+security"的实现是一个综合性的安全方案,结合了网络层的SSH安全通信与应用层的Spring Security精细权限管理...

    ssh固定配置文件.rar

    固定配置文件可能包含连接池的初始化大小、最大连接数、超时时间等参数。 5. **日志配置**(log4j.properties或logback.xml):日志系统记录应用程序运行过程中的信息,对于调试和问题排查至关重要。配置文件定义了...

    ssh整合的常用配置文件,包括所有配置文件,需要的童鞋进行下载。

    2. **struts.xml**:Struts2框架的核心配置文件,它定义了Action类与URL的映射,处理请求的方式,结果页面的跳转规则,以及拦截器的配置。通过此文件,开发者可以控制应用程序的流程,实现MVC模式中的Controller层。...

    myeclipse新建SSH项目的步骤struts2+spring+hibernate

    - 在web.xml中配置session超时时间,如`&lt;session-config&gt;&lt;session-timeout&gt;30&lt;/session-timeout&gt;&lt;/session-config&gt;`,单位为分钟。 - 可以通过监听器或Controller检测session过期,并进行相应的处理。 7. **...

    Hibernate的配置文件

    在Java Web开发中,SSH(Struts、Spring、Hibernate)是经典的三大框架,它们共同构建了一个强大的企业级应用开发环境。Hibernate作为一个优秀的对象关系映射(ORM)框架,极大地简化了数据库操作。在这个场景中,...

    详解SSH框架和Redis的整合

    2. **Redis配置**:创建`redis.properties`文件,配置Redis服务器的连接信息,包括主机地址(redis.host)、端口号(redis.port)、默认数据库(redis.default.db)、超时时间(redis.timeout)、最大活动连接数...

    在SSH中使用事物包括SSH的搭建和配置;事物的配置;注释详细

    注解可以设置事务属性,如传播行为、隔离级别、超时时间等。 **详细注释**: 在配置文件中,注释应详细说明每个元素的作用,例如在Spring的配置文件中,`&lt;tx:annotation-driven&gt;`的`transaction-manager`属性指定...

    extjs整合ssh框架

    同时,需要在`web.xml`中配置EXTJS的静态资源路径,以使服务器能够正确处理EXTJS的CSS和JavaScript文件。 **步骤5:配置Tomcat的GZIP压缩** 为了提高性能,我们可以启用Tomcat的GZIP压缩。在Tomcat的`conf/server....

    ssh 整合连接池

    例如,C3P0提供了一套完整的连接池配置参数,包括最小连接数、最大连接数、连接超时时间等,通过调整这些参数,开发者可以根据实际需求和系统负载来优化连接池性能。 在SSH整合中,Spring框架通常扮演着整合者的...

    SSH各种问题集合及解决方案

    - 检查`web.xml`和`struts-config.xml`文件,确保所有Action都被正确配置。 - 确认jsp页面中的表单提交路径与配置文件中的路径一致。 7. **类库缺失问题**: - 如果遇到`NoClassDefFoundError`这类错误,表示类库...

    ssh数据库连接池proxool

    3. **整合SSH**:在Struts的配置文件(如`struts-config.xml`)、Spring的配置文件(如`applicationContext.xml`)以及Hibernate的配置文件(如`hibernate.cfg.xml`)中引用Proxool的配置,指定数据源。 4. **编程...

    非常好的SSH开发入门框架

    常见的连接池工具有C3P0、DBCP、HikariCP等,它们通常需要设置初始大小、最大连接数、超时时间等相关参数。 6. JSP(JavaServer Pages):在文件列表中,main1.jsp、main.jsp、index.jsp是JSP文件,它们是动态网页...

    ssh 框架整合

    2. **配置c3p0**:在Hibernate的配置文件`hibernate.cfg.xml`中,添加c3p0的相关配置,如最小连接数、最大连接数、获取连接超时时间等。 ```xml &lt;property name="connection.provider_class"&gt;org.hibernate....

    ssh整合shiro

    SSH整合Shiro是Java Web开发中的一个重要话题,它涉及到Spring、Struts2和Hibernate这三个主流框架与Apache Shiro安全框架的集成。这篇文章将详细介绍SSH框架的整合过程以及Shiro的安全管理功能。 首先,SSH...

Global site tag (gtag.js) - Google Analytics