二、编写第一个 Spring MVC 程序

文章目录

  • 一、编写第一个 Spring MVC 程序




一、编写第一个 Spring MVC 程序


  • 代码示例

    • 创建 maven 项目,以此项目为父项目,在父项目的 pom.xml 中导入相关依赖

      <dependencies>
         <dependency>
             <groupId>junitgroupId>
             <artifactId>junitartifactId>
             <version>4.12version>
         dependency>
         <dependency>
             <groupId>org.springframeworkgroupId>
             <artifactId>spring-webmvcartifactId>
             <version>5.1.9.RELEASEversion>
         dependency>
         <dependency>
             <groupId>javax.servletgroupId>
             <artifactId>servlet-apiartifactId>
             <version>2.5version>
         dependency>
         <dependency>
             <groupId>javax.servlet.jspgroupId>
             <artifactId>jsp-apiartifactId>
             <version>2.2version>
         dependency>
         <dependency>
             <groupId>javax.servletgroupId>
             <artifactId>jstlartifactId>
             <version>1.2version>
         dependency>
      dependencies>
      
  • 在父项目上右键创建子项目,创建完成之后,在子项目上右键选中 Add framework support 找到 Web Application 勾选上

    • 具体步骤

    • 勾选完之后项目会出现 web 目录

你可能感兴趣的:(spring,mvc,hive)