最全三大框架整合(使用映射)——struts.xml和web.xml配置

简介: 最全三大框架整合(使用映射)——数据库资源文件jdbc.properties
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
  <package name="default" namespace="/" extends="struts-default">
    <action name="add" class="deptAction" method="addDept">
      <result name="success">suc.jsp</result>
    </action>
  </package>
</struts>



web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 
  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_3_0.xsd">
  <display-name></display-name> 
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:applicationContext.xml,
          classpath:applicationContext-*.xml
    </param-value>
  </context-param>
  <filter>
    <filter-name>openSessionInViewFilter</filter-name>
    <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
  
  <init-param>   
  
           <param-name>flushMode</param-name>   
  
           <param-value>AUTO</param-value>   
  
    </init-param>
 
  </filter>
  <filter-mapping>
    <filter-name>openSessionInViewFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <filter>
    <filter-name>struts2</filter-name>
    <filter-class>
      org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
    </filter-class>
  </filter>
  <filter-mapping>
    <filter-name>struts2</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping></web-app>


相关文章
|
6天前
【Azure 应用服务】Web App Service 中的 应用程序配置(Application Setting) 怎么获取key vault中的值
【Azure 应用服务】Web App Service 中的 应用程序配置(Application Setting) 怎么获取key vault中的值
|
9天前
|
Ubuntu 应用服务中间件 Linux
在Linux中,如何配置Web服务器(如Apache或Nginx)?
在Linux中,如何配置Web服务器(如Apache或Nginx)?
|
9天前
|
Serverless 对象存储
现代化 Web 应用构建问题之配置Serverless Devs的秘钥信息如何解决
现代化 Web 应用构建问题之配置Serverless Devs的秘钥信息如何解决
17 1
|
7天前
|
Web App开发 安全 JavaScript
【Azure 应用服务】App Service 通过配置web.config来添加请求返回的响应头(Response Header)
【Azure 应用服务】App Service 通过配置web.config来添加请求返回的响应头(Response Header)
|
8天前
|
JavaScript Java Python
【Azure 应用服务】在Azure App Service for Windows 中部署Java/NodeJS/Python项目时,web.config的配置模板内容
【Azure 应用服务】在Azure App Service for Windows 中部署Java/NodeJS/Python项目时,web.config的配置模板内容
|
9天前
|
应用服务中间件 Linux 网络安全
在Linux中,如何配置Apache或Nginx Web服务器?
在Linux中,如何配置Apache或Nginx Web服务器?
|
16天前
|
存储 缓存 Ubuntu
如何在 Apache Web 服务器中安装、配置和使用模块
如何在 Apache Web 服务器中安装、配置和使用模块
30 0
|
16天前
|
应用服务中间件
2022年最新最详细在IDEA中配置Tomcat(含有详细图解过程)、建立使用IEDA建立一个Web项目的案例
这篇文章提供了在IntelliJ IDEA中配置Tomcat服务器的详细步骤,包括添加Tomcat Server、选择安装路径、添加项目Artifact,以及创建和展示Web项目的流程。
|
16天前
|
存储 Ubuntu 应用服务中间件
如何在虚拟专用服务器上配置 Nginx Web 服务器
如何在虚拟专用服务器上配置 Nginx Web 服务器
13 0
|
16天前
|
存储 Ubuntu 测试技术
如何在 Ubuntu 或 Debian VPS 上配置 Apache Web 服务器
如何在 Ubuntu 或 Debian VPS 上配置 Apache Web 服务器
23 0
下一篇
云函数