A5下载 - 努力做内容最丰富最安全的下载站!

A5站长下载站

当前位置:A5下载 > 编程开发 > 网站开发 > web.xml配置(ssh项目)

web.xml配置(ssh项目)

时间:2015-09-23 16:31作者:yezheng人气:223

本文小编将为大家介绍一个简单的web.xml配置(ssh项目),有需要的朋友来看看这篇教程吧

代码如下:

web.xml配置

<!-- 配置不同目录的首页集:welcome-file-list -->

<welcome-file-list>

<welcome-file>login.jsp</welcome-file>

<welcome-file>index.jsp</welcome-file>

</welcome-file-list>

配置监听器和上下文参数和struts2过滤器

<!-- 配置上下文参数:contextConfigLocation -->

<context-param>

<param-name>contextConfigLocation</param-name>

<param-value>classpath:config/applicationContext-*.xml</param-value>

</context-param>

<!-- 配置监听器:在web项目启动时初始化IoC容器(装配 contextConfigLocation参数所指定的文件的配置信息)-->

<listener>

<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

</listener>

<!-- 配置Struts2总控制器,必须是最后一个filtermapping -->

<filter>

<filter-name>struts2</filter-name>

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

<init-param>

<param-name>config</param-name>

<param-value>struts-default.xml,struts-plugin.xml,/config/struts.xml</param-value>

</init-param>

</filter>

<filter-mapping>

<filter-name>struts2</filter-name>

<url-pattern>/*</url-pattern>

</filter-mapping>

配置过滤器,解决乱码、懒加载等问题

标签web.xml,配置,ssh,项目,本文,小编,将为,大家

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

公众号