<?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>
分享到:
相关推荐
在Java Web开发中,`struts.xml`, `applicationContext.xml` 和 `web.xml` 是三个至关重要的配置文件,它们各自负责不同的职责,并协同工作来构建一个完整的应用框架。以下是关于这三个配置文件的详细说明。 首先,...
在这个文件中,可以配置过滤器、监听器、Servlet、Session超时、错误页面等。在SSH框架中,web.xml通常用于注册DispatcherServlet(Spring MVC的前端控制器)、Filter(如Struts2的FilterDispatcher)以及Spring的...
1. web.xml 文件配置:配置 web.xml 文件,以确保正确的 Web 应用程序部署。 2. Plug-in 配置:配置 Plug-in,以确保正确的扩展功能。 3. message-resources 配置:配置 message-resources,以确保正确的国际化和...
Web SSH XML 文件是一种在Web应用程序中使用SSH(Secure Shell)服务时所涉及的配置文件,主要以XML(Extensible Markup Language)格式存储。对于初学者来说,这些文件提供了理解和实践SSH连接、安全通信以及Web...
- Spring Security的配置类或XML配置文件,定义了权限控制规则、认证源和访问决策策略。 综上所述,"ssh+security"的实现是一个综合性的安全方案,结合了网络层的SSH安全通信与应用层的Spring Security精细权限管理...
固定配置文件可能包含连接池的初始化大小、最大连接数、超时时间等参数。 5. **日志配置**(log4j.properties或logback.xml):日志系统记录应用程序运行过程中的信息,对于调试和问题排查至关重要。配置文件定义了...
2. **struts.xml**:Struts2框架的核心配置文件,它定义了Action类与URL的映射,处理请求的方式,结果页面的跳转规则,以及拦截器的配置。通过此文件,开发者可以控制应用程序的流程,实现MVC模式中的Controller层。...
- 在web.xml中配置session超时时间,如`<session-config><session-timeout>30</session-timeout></session-config>`,单位为分钟。 - 可以通过监听器或Controller检测session过期,并进行相应的处理。 7. **...
- **配置文件错误**:检查`hibernate.cfg.xml`和`applicationContext.xml`中的XML语法是否正确。 - **SessionFactory创建失败**:检查数据库连接信息是否正确,以及Spring对SessionFactory的配置。 - **运行时异常**...
在Java Web开发中,SSH(Struts、Spring、Hibernate)是经典的三大框架,它们共同构建了一个强大的企业级应用开发环境。Hibernate作为一个优秀的对象关系映射(ORM)框架,极大地简化了数据库操作。在这个场景中,...
2. **Redis配置**:创建`redis.properties`文件,配置Redis服务器的连接信息,包括主机地址(redis.host)、端口号(redis.port)、默认数据库(redis.default.db)、超时时间(redis.timeout)、最大活动连接数...
注解可以设置事务属性,如传播行为、隔离级别、超时时间等。 **详细注释**: 在配置文件中,注释应详细说明每个元素的作用,例如在Spring的配置文件中,`<tx:annotation-driven>`的`transaction-manager`属性指定...
同时,需要在`web.xml`中配置EXTJS的静态资源路径,以使服务器能够正确处理EXTJS的CSS和JavaScript文件。 **步骤5:配置Tomcat的GZIP压缩** 为了提高性能,我们可以启用Tomcat的GZIP压缩。在Tomcat的`conf/server....
- 检查`web.xml`和`struts-config.xml`文件,确保所有Action都被正确配置。 - 确认jsp页面中的表单提交路径与配置文件中的路径一致。 7. **类库缺失问题**: - 如果遇到`NoClassDefFoundError`这类错误,表示类库...
例如,C3P0提供了一套完整的连接池配置参数,包括最小连接数、最大连接数、连接超时时间等,通过调整这些参数,开发者可以根据实际需求和系统负载来优化连接池性能。 在SSH整合中,Spring框架通常扮演着整合者的...
3. **整合SSH**:在Struts的配置文件(如`struts-config.xml`)、Spring的配置文件(如`applicationContext.xml`)以及Hibernate的配置文件(如`hibernate.cfg.xml`)中引用Proxool的配置,指定数据源。 4. **编程...
常见的连接池工具有C3P0、DBCP、HikariCP等,它们通常需要设置初始大小、最大连接数、超时时间等相关参数。 6. JSP(JavaServer Pages):在文件列表中,main1.jsp、main.jsp、index.jsp是JSP文件,它们是动态网页...
2. **配置c3p0**:在Hibernate的配置文件`hibernate.cfg.xml`中,添加c3p0的相关配置,如最小连接数、最大连接数、获取连接超时时间等。 ```xml <property name="connection.provider_class">org.hibernate....
SSH整合Shiro是Java Web开发中的一个重要话题,它涉及到Spring、Struts2和Hibernate这三个主流框架与Apache Shiro安全框架的集成。这篇文章将详细介绍SSH框架的整合过程以及Shiro的安全管理功能。 首先,SSH...