引入Struts2

在pom.xml中加入jar包

<!-- struts2 -->
      <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-core</artifactId>
        <version>2.3.4.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-spring-plugin</artifactId>
        <version>2.3.4.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-convention-plugin</artifactId>
        <version>2.3.4.1</version>
    </dependency>

在resource中加入struts.xml

MyEclipse — Maven+Spring+Struts+Hibernate 整合 [学习笔记-3]MyEclipse — Maven+Spring+Struts+Hibernate 整合 [学习笔记-3]

创建UserAction类,并添加注解

MyEclipse — Maven+Spring+Struts+Hibernate 整合 [学习笔记-3]

在Web.xml中加入Struts2配置

MyEclipse — Maven+Spring+Struts+Hibernate 整合 [学习笔记-3]

============Struts 加入完毕======================

 

 

项目编码UTF-8

相关文章:

  • 2021-05-27
  • 2022-01-01
  • 2021-07-08
  • 2021-08-27
  • 2022-12-23
  • 2021-12-01
猜你喜欢
  • 2021-09-21
  • 2021-10-04
  • 2022-02-08
  • 2022-02-16
  • 2021-05-29
  • 2022-12-23
  • 2021-07-25
相关资源
相似解决方案