当前位置:   article > 正文

(特详细)使用eclipse+maven搭建ssm框架_eclipse maven ssm

eclipse maven ssm

使用eclipse+maven搭建ssm框架 - 简书事先准备好系统环境 Window 10 JDK1.8 Eclipse Java EE IDE for Web Developers(Version: Neon Release...https://www.jianshu.com/p/f3c582edca2b

事先准备好系统环境

使用maven创建SSM框架

  1. 选择Maven Project

     

  2. 选择默认工作空间位置

     

  3. 选择web类型

     

  4. 填写GroupID、ArtifactID
    Group ID:相当于一个组织
    Artifact ID:相当于这个组织下的一个具体项目
    Packege:根据Group ID和Artifact ID生成一个默认的名称

     

  5. 创建出的maven项目如下图

     

     

    提示错误:

     


    解决办法:在eclipse中设置Server为Tomcat,注意JRE设置为安装的JDK的jre

     

    在工程上右键,查看工程属性,找到Java Build Path,添加Server Runtime为Tomcat

     

     


    点击Finish后,项目工程变成下图

  6. 在项目上点击右键,查看项目信息


    默认的Dynamic Web Module为2.3,使用Tomcat 8.5,需要修改为3.1
    修改方法:
    ① maven工程所在目录有个.settings文件夹(默认隐藏)下面有个文件org.eclipse.wst.common.project.facet.core.xml


    将内容改为:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <faceted-project>
  3. <fixed facet="wst.jsdt.web"/>
  4. <installed facet="java" version="1.8"/>
  5. <installed facet="jst.web" version="3.0"/>
  6. <installed facet="wst.jsdt.web" version="1.0"/>
  7. </faceted-project>

② maven工程下的web.xml文件修改为

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
  4. version="3.1" metadata-complete="true">
  5. </web-app>

③ pom.xml文件中修改build节点,添加如下内容

  1. <plugins>
  2. <plugin>
  3. <groupId>org.apache.maven.plugins</groupId>
  4. <artifactId>maven-compiler-plugin</artifactId>
  5. <configuration>
  6. <source>1.8</source>
  7. <target>1.8</target>
  8. </configuration>
  9. </plugin>
  10. </plugins>

④ 修改后,在项目上右键,找到Maven属性下的Update Project,点击之

⑤ 选择该项目进行更新,如果怕不能强制更新,可以勾选Force Update of Snapshots/Releases
⑥ 点击OK后更新maven项目,再观察项目属性,Module已经变为3.1

下载ssm框架所需的jar包

修改pom.xml内容为

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>com.huyonghua</groupId>
  5. <artifactId>ssm</artifactId>
  6. <packaging>war</packaging>
  7. <version>0.0.1-SNAPSHOT</version>
  8. <name>ssm Maven Webapp</name>
  9. <url>http://maven.apache.org</url>
  10. <properties>
  11. <!-- Spring版本号 -->
  12. <spring.version>4.3.8.RELEASE</spring.version>
  13. </properties>
  14. <dependencies>
  15. <!-- 添加Servlet支持 -->
  16. <dependency>
  17. <groupId>javax.servlet</groupId>
  18. <artifactId>javax.servlet-api</artifactId>
  19. <version>3.1.0</version>
  20. <scope>provided</scope>
  21. </dependency>
  22. <dependency>
  23. <groupId>javax.servlet.jsp</groupId>
  24. <artifactId>javax.servlet.jsp-api</artifactId>
  25. <version>2.3.1</version>
  26. <scope>provided</scope>
  27. </dependency>
  28. <!-- JSP标准标签库 -->
  29. <dependency>
  30. <groupId>javax.servlet</groupId>
  31. <artifactId>jstl</artifactId>
  32. <version>1.2</version>
  33. </dependency>
  34. <!-- Spring相关包 -->
  35. <dependency>
  36. <groupId>org.springframework</groupId>
  37. <artifactId>spring-core</artifactId>
  38. <version>${spring.version}</version>
  39. </dependency>
  40. <dependency>
  41. <groupId>org.springframework</groupId>
  42. <artifactId>spring-aop</artifactId>
  43. <version>${spring.version}</version>
  44. </dependency>
  45. <dependency>
  46. <groupId>org.springframework</groupId>
  47. <artifactId>spring-web</artifactId>
  48. <version>${spring.version}</version>
  49. </dependency>
  50. <dependency>
  51. <groupId>org.springframework</groupId>
  52. <artifactId>spring-webmvc</artifactId>
  53. <version>${spring.version}</version>
  54. </dependency>
  55. <dependency>
  56. <groupId>org.springframework</groupId>
  57. <artifactId>spring-jdbc</artifactId>
  58. <version>${spring.version}</version>
  59. </dependency>
  60. <dependency>
  61. <groupId>org.springframework</groupId>
  62. <artifactId>spring-tx</artifactId>
  63. <version>${spring.version}</version>
  64. </dependency>
  65. <!-- AOP相关包 -->
  66. <dependency>
  67. <groupId>org.aspectj</groupId>
  68. <artifactId>aspectjrt</artifactId>
  69. <version>1.8.0</version>
  70. </dependency>
  71. <dependency>
  72. <groupId>org.aspectj</groupId>
  73. <artifactId>aspectjweaver</artifactId>
  74. <version>1.8.0</version>
  75. </dependency>
  76. <!-- MyBatis相关包 -->
  77. <dependency>
  78. <groupId>org.mybatis</groupId>
  79. <artifactId>mybatis</artifactId>
  80. <version>3.3.0</version>
  81. </dependency>
  82. <!-- MySQL相关包 -->
  83. <dependency>
  84. <groupId>mysql</groupId>
  85. <artifactId>mysql-connector-java</artifactId>
  86. <version>5.1.26</version>
  87. </dependency>
  88. <!-- 数据库连接池 -->
  89. <dependency>
  90. <groupId>com.alibaba</groupId>
  91. <artifactId>druid</artifactId>
  92. <version>1.0.20</version>
  93. </dependency>
  94. <!-- Spring集成MyBatis -->
  95. <dependency>
  96. <groupId>org.mybatis</groupId>
  97. <artifactId>mybatis-spring</artifactId>
  98. <version>1.2.3</version>
  99. </dependency>
  100. <!-- 日志相关包 -->
  101. <dependency>
  102. <groupId>log4j</groupId>
  103. <artifactId>log4j</artifactId>
  104. <version>1.2.17</version>
  105. </dependency>
  106. <dependency>
  107. <groupId>org.slf4j</groupId>
  108. <artifactId>slf4j-api</artifactId>
  109. <version>1.7.21</version>
  110. </dependency>
  111. <!-- 单元测试相关包 -->
  112. <dependency>
  113. <groupId>junit</groupId>
  114. <artifactId>junit</artifactId>
  115. <version>3.8.1</version>
  116. <scope>test</scope>
  117. </dependency>
  118. </dependencies>
  119. <build>
  120. <finalName>ssm</finalName>
  121. <plugins>
  122. <plugin>
  123. <groupId>org.apache.maven.plugins</groupId>
  124. <artifactId>maven-compiler-plugin</artifactId>
  125. <configuration>
  126. <source>1.8</source>
  127. <target>1.8</target>
  128. </configuration>
  129. </plugin>
  130. </plugins>
  131. </build>
  132. </project>

保存后,可以看到相关jar包被下载至本地仓库

完善项目结构

因为服务端maven项目的标准结构有四个子包:src/main/java、src/main/resources、src/test/java、src/test/resources,这里缺少了src/test/resources,所以手动补上。
在项目中新建Source Folder

创建src/test/resoures目录后,工程如下图所示


右键查看项目属性,点击Deployment Assembly,移除test和target

Web Deployment Assembly是eclipse中的发布路径设置,DeployPath表示每个资源发布之后的文件路径。eclipse中使用tomcat使用启动web项目的流程是 java build path编译项目源代码生成的class文件放到buildpath的设置路径中,根据web deployment assembly将项目中的各个资源发布到设置的指定文件中

框架测试

  1. 创建项目中用的配置文件

     

log4j.properties

  1. #USE THIS SETTING FOR OUTPUT MYBATIS`s SQL ON THE CONSOLE
  2. log4j.rootLogger=DEBUG, Console
  3. #Console
  4. log4j.appender.Console=org.apache.log4j.ConsoleAppender
  5. log4j.appender.Console.layout=org.apache.log4j.PatternLayout
  6. log4j.appender.Console.layout.ConversionPattern=%d [%t] %-5p [%c] - %m%n
  7. log4j.logger.java.sql.ResultSet=INFO
  8. log4j.logger.org.apache=INFO
  9. log4j.logger.java.sql.Connection=DEBUG
  10. log4j.logger.java.sql.Statement=DEBUG
  11. log4j.logger.java.sql.PreparedStatement=DEBUG

srping-core.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:aop="http://www.springframework.org/schema/aop"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xsi:schemaLocation="
  8. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  9. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  10. http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
  11. http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
  12. <!-- 开启AOP注解扫描 -->
  13. <aop:aspectj-autoproxy proxy-target-class="true" />
  14. <!-- 事务管理器,依赖于数据源 -->
  15. <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  16. <property name="dataSource" ref="dataSource" />
  17. </bean>
  18. <!-- 编写通知:对事务进行增强(通知),需要编写对切入点和具体执行事务细节 -->
  19. <tx:advice id="txAdvice" transaction-manager="txManager">
  20. <tx:attributes>
  21. <!--
  22. 为切入点方法添加事务详情
  23. name:方法名,*表示任意方法名称
  24. propagation:设置传播行为
  25. isolation:设置隔离级别
  26. read-only:是否只读
  27. -->
  28. <tx:method name="add*" propagation="REQUIRED" isolation="DEFAULT" read-only="false" rollback-for="Exception" />
  29. <tx:method name="delete*" propagation="REQUIRED" isolation="DEFAULT" read-only="false" rollback-for="Exception" />
  30. <tx:method name="update*" propagation="REQUIRED" isolation="DEFAULT" read-only="false" rollback-for="Exception" />
  31. </tx:attributes>
  32. </tx:advice>
  33. <!-- 设置AOP,让Spring自动对目标生成代理,需要使用AspectJ表达式 -->
  34. <aop:config proxy-target-class="true">
  35. <!-- 切面:整合切入点和通知 -->
  36. <aop:advisor advice-ref="txAdvice" pointcut="within(com.huyonghua.web..*)" />
  37. </aop:config>
  38. <!-- 导入其他配置文件 -->
  39. <import resource="spring-mybatis.xml" />
  40. <!-- 扫描service -->
  41. <context:component-scan base-package="com.huyonghua.service"></context:component-scan>
  42. </beans>

spring-mvc.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
  4. xmlns:mvc="http://www.springframework.org/schema/mvc"
  5. xsi:schemaLocation="
  6. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  7. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  8. http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
  9. <!-- 启动自动扫描 -->
  10. <context:component-scan base-package="com.huyonghua.web" />
  11. <!-- 注册MVC注解驱动 -->
  12. <mvc:annotation-driven />
  13. <!-- 静态资源可访问的设置方式 -->
  14. <mvc:default-servlet-handler />
  15. <!-- 配置视图解析器,可以显式设置,也可以不设置,不设置会依据SpringMVC的默认设置 -->
  16. <bean id="viewResolver"
  17. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  18. <property name="prefix" value="/" />
  19. <property name="suffix" value=".jsp" />
  20. </bean>
  21. </beans>

spring-mybatis.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xsi:schemaLocation="
  5. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
  6. <!-- 定义数据源Bean -->
  7. <!-- Druid -->
  8. <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
  9. <property name="url" value="jdbc:mysql://localhost:3306/test" />
  10. <property name="username" value="root" />
  11. <property name="password" value="123456" />
  12. </bean>
  13. <!-- 注册SqlSessionFactoryBean -->
  14. <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  15. <property name="dataSource" ref="dataSource" />
  16. <!-- 自动扫描mappers.xml文件 -->
  17. <property name="mapperLocations" value="classpath:com/huyonghua/dao/*.xml"></property>
  18. <property name="configLocation" value="classpath:mybatis-config.xml"></property>
  19. </bean>
  20. <!-- DAO接口所在包名,Spring会自动查找其下的类 -->
  21. <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
  22. <property name="basePackage" value="com.huyonghua.dao" />
  23. <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
  24. </bean>
  25. </beans>

mybatis-config.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE configuration
  3. PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-config.dtd">
  5. <configuration>
  6. <!-- 设置实体别名 -->
  7. <typeAliases>
  8. <package name="com.huyonghua.domain" />
  9. </typeAliases>
  10. </configuration>

配置web.xml启用spring容器

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3. xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
  4. version="3.1" metadata-complete="true">
  5. <welcome-file-list>
  6. <welcome-file>index.jsp</welcome-file>
  7. </welcome-file-list>
  8. <!-- Spring配置文件 -->
  9. <context-param>
  10. <param-name>contextConfigLocation</param-name>
  11. <param-value>classpath:spring-core.xml</param-value>
  12. </context-param>
  13. <!-- 编码过滤器 -->
  14. <filter>
  15. <filter-name>encodingFilter</filter-name>
  16. <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  17. <async-supported>true</async-supported>
  18. <init-param>
  19. <param-name>encoding</param-name>
  20. <param-value>UTF-8</param-value>
  21. </init-param>
  22. </filter>
  23. <filter-mapping>
  24. <filter-name>encodingFilter</filter-name>
  25. <url-pattern>/*</url-pattern>
  26. </filter-mapping>
  27. <!-- Spring监听器 -->
  28. <listener>
  29. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  30. </listener>
  31. <!-- 添加对springmvc的支持 -->
  32. <servlet>
  33. <servlet-name>springMVC</servlet-name>
  34. <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
  35. <init-param>
  36. <param-name>contextConfigLocation</param-name>
  37. <param-value>classpath:spring-mvc.xml</param-value>
  38. </init-param>
  39. <load-on-startup>1</load-on-startup>
  40. <async-supported>true</async-supported>
  41. </servlet>
  42. <servlet-mapping>
  43. <servlet-name>springMVC</servlet-name>
  44. <url-pattern>*.do</url-pattern>
  45. </servlet-mapping>
  46. </web-app>
  1. 数据库插入测试数据
    创建一个test数据库,并建一个userinfo的表,表结构如下

     

     

    插入测试数据

     

  2. 编写服务端代码

     

     

    User.java

  1. package com.huyonghua.domain;
  2. /**
  3. * 用户信息
  4. */
  5. public class User {
  6. // 成员变量
  7. private Integer userid;
  8. private String username;
  9. private String password;
  10. // 构造函数
  11. public User() {
  12. super();
  13. }
  14. public User(Integer userid, String username, String password) {
  15. super();
  16. this.userid = userid;
  17. this.username = username;
  18. this.password = password;
  19. }
  20. // 成员方法
  21. public Integer getUserid() {
  22. return userid;
  23. }
  24. public void setUserid(Integer userid) {
  25. this.userid = userid;
  26. }
  27. public String getUsername() {
  28. return username;
  29. }
  30. public void setUsername(String username) {
  31. this.username = username;
  32. }
  33. public String getPassword() {
  34. return password;
  35. }
  36. public void setPassword(String password) {
  37. this.password = password;
  38. }
  39. }

UserDao.java

  1. package com.huyonghua.dao;
  2. import com.huyonghua.domain.User;
  3. public interface UserDao {
  4. public User findByUsername(String username);
  5. }

UserMapper.xml

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  4. <mapper namespace="com.huyonghua.dao.UserDao">
  5. <select id="findByUsername" parameterType="string" resultType="User">
  6. SELECT * FROM userinfo WHERE username=#{username}
  7. </select>
  8. </mapper>

UserService.java

  1. package com.huyonghua.service;
  2. import com.huyonghua.domain.User;
  3. public interface UserService {
  4. public User findUserByName(String name);
  5. }

UserServiceImpl.java

  1. package com.huyonghua.service.impl;
  2. import org.springframework.beans.factory.annotation.Autowired;
  3. import org.springframework.stereotype.Service;
  4. import org.springframework.transaction.annotation.Transactional;
  5. import com.huyonghua.dao.UserDao;
  6. import com.huyonghua.domain.User;
  7. import com.huyonghua.service.UserService;
  8. @Service
  9. @Transactional
  10. public class UserServiceImpl implements UserService{
  11. @Autowired
  12. private UserDao userDao;
  13. @Override
  14. public User findUserByName(String name) {
  15. // TODO Auto-generated method stub
  16. return this.userDao.findByUsername(name);
  17. }
  18. }

UserController.java

  1. package com.huyonghua.web;
  2. import javax.servlet.http.HttpSession;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Controller;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestMethod;
  7. import org.springframework.web.servlet.ModelAndView;
  8. import com.huyonghua.domain.User;
  9. import com.huyonghua.service.UserService;
  10. /**
  11. * 用户控制器
  12. */
  13. @Controller
  14. @RequestMapping(value = "/user")
  15. public class UserController {
  16. @Autowired
  17. private UserService userService;
  18. @RequestMapping(value = "/login", method = RequestMethod.POST)
  19. public ModelAndView login(User model, HttpSession session) {
  20. User user = userService.findUserByName(model.getUsername());
  21. if (user == null || !user.getPassword().equals(model.getPassword())) {
  22. return new ModelAndView("redirect:/login.jsp");
  23. } else {
  24. session.setAttribute("user", user);
  25. ModelAndView mav = new ModelAndView();
  26. mav.setViewName("index");
  27. return mav;
  28. }
  29. }
  30. }
  1. 编写客户端代码

     

     

    login.jsp

  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <title>登录</title>
  7. </head>
  8. <body>
  9. <form action="${pageContext.request.contextPath }/user/login.do" method="post">
  10. <label>账号:</label>
  11. <input type="text" id="txtUsername" name="username" placeholder="请输入账号" /><br/>
  12. <label>密码:</label>
  13. <input type="password" id="txtPassword" name="password" placeholder="请输入密码" /><br/>
  14. <input type="submit" value="提交" />
  15. <input type="reset" value="重置" />
  16. </form>
  17. </body>
  18. </html>

index.jsp

  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <title>主页</title>
  7. </head>
  8. <body>
  9. <h3>欢迎,${user.username }</h3>
  10. </body>
  11. </html>
  1. 发布项目到tomcat
    右键项目-->run as-->run on server

     

     

本文源码已发布到我的github仓库,欢迎大家Fork and Star!

git@github.com:goldfather008/ssm.git

问题

tomcat运行报错。The Tomcat server configuration at \Servers\Tomcat v7.0 Server at localhost-config is missing. Check the server for errors.
原因:可能不小心删除了Project Explorer下的Server
解决办法:Window-Preferences-Server-Server Runtime Environments重新关联就可以了

查询数据库时发现报错Invalid bound statement (not found)
原因:mybaits的配置文件与接口调用没有对应,一般情况是Mapepr.xml文件中nameapce没有和mapper接口发生映射,导致mybatis绑定失败,检查是否正确配置映射

tomcat在eclipse里面能正常启动,而在浏览器中访问http://localhost:8080/不能访问,且报404错误。同时其他项目页面也不能访问。
关闭eclipse里面的tomcat,在tomcat安装目录下双击startup.bat手动启动tomcat服务器。访问http://localhost:8080/能正常访问tomcat管理页面。
原因:eclipse将tomcat的项目发布目录(tomcat 目录中的webapp)重定向了,所以你会发现在tomcat安装目录下的webapp目录里面找不到你的项目文件。
解决办法:重新配置下tomcat服务器:
在eclipse中的server页面,双击tomcat服务,会看到如图所示的配置页面:

可以看到红圈中选择的是 Use workspace metadata(does not modify Tomcat installion)
如果该tomcat中部署了项目的话,这红圈中的选项会灰掉不能修改,要修改必须得先把tomcat中的部署的服务都移除。

通过右键单击tomcat服务器选择 Add and Remove,在弹出的对话框中移除已部署的项目。移除完确定后,将看到上面的选项面板部分可编辑了。
选择Use tomcat installation(Task control of Tomcat installation) 即选择tomcat的安装目录来作为项目的发布目录。
然后,下来四行,看到"Deploy Path"了没?它后面的值默认是"wtpwebapps",把它改成"webapps",也就是tomcat
中发布项目所在的文件夹名字。
修改后关掉该页面,保存配置。这样就将项目部署到了tomcat安装目录下的webapp

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/135832
推荐阅读
相关标签
  

闽ICP备14008679号