Struts2 Action : Maven 配置

Struts2 Action 记录 作者: LinkSystem Maven 2017/04/11

Struts2 Action 是我关于Struts2的实践记录,该实践的构建环境以下:

  • IDE : IntelliJ IDEA 2016.3.5

  • Maven : Maven 3.3.9

注意事项

  • 在Ajax的响应中,我是以Json作为响应内容,在基于Struts2引入相关插件即 struts2-json-plugin 来支持Json的响应。

以下是该项目的 pom.xml 文件的代码,需要注意的是该实践仅以Struts2为主,同时该实践的dependency的来源是在The Central Repository可查的。该实践的版本统一在properties

版本模块
<properties>
    <struts2.version>2.5.10</struts2.version>
    <servlet.version>3.1.0</servlet.version>
    <junit.version>4.12</junit.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>
依赖模块
<dependencies>
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-core</artifactId>
      <version>${struts2.version}</version>
    </dependency>
    
    <dependency>
      <groupId>org.apache.struts</groupId>
      <artifactId>struts2-json-plugin</artifactId>
      <version>${struts2.version}</version>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>${servlet.version}</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
    原文作者:linksystem
    原文地址: https://segmentfault.com/a/1190000009030439
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞