CMS 1.项目准备

1.搭建基础目录结构

请添加图片描述
请添加图片描述
请添加图片描述

请添加图片描述

 <packaging>war</packaging>
    <properties><!-- 指定jdk版本号 -->
    <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <!-- 指定项目编码 -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

2.解压apache-maven-3.6.3,将conf里的settings文件复制到文件夹,然后打开

请添加图片描述

请添加图片描述
请添加图片描述

3.修改localrepository

请添加图片描述

4.修改mirror

在这里插入图片描述

5.修改settings,执行刷新

在这里插入图片描述
在这里插入图片描述

(webapp会有蓝色圈圈出现)
在这里插入图片描述
在这里插入图片描述

6.配置web.xml

在这里插入图片描述在这里插入图片描述

7.打开project structure

在这里插入图片描述

8.setting搜索lombok,下载

在这里插入图片描述
一定要保证Enable annotation processing是勾选状态

在这里插入图片描述

9.编写插件依赖

在这里插入图片描述

10.编辑web.xml,在webapp(项目根目录)下新建文件夹error,新建400.jsp,404.jsp,500.jsp

在这里插入图片描述

目录结构:
在这里插入图片描述

11.在resources下新建xml,Spring Config,spring-mvc

在这里插入图片描述
在这里插入图片描述

spring-mav

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- 打开注解驱动 -->
    <mvc:annotation-driven></mvc:annotation-driven>
    <!--指定需要由Spring自主加载的类所在包 定义注解驱动主动扫描的包 -->
    <context:component-scan base-package="edu.td.xd"/>
    <!-- 创建视图解析器-->
    <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
     <property name="prefix" value=""></property><!--定义前缀 -->
     <property name="suffix" value=""></property><!--定义前缀 -->
     <property name="order" value="1"></property><!--当有多个视图解析器时,排序执行ASC -->
     <property name="viewClass" value="org.springframework.web.servlet.view.InternalResourceView"></property>
    </bean>
</beans>

注:apache-maven必须导入bin包,否则会报错,因为我的IDEA版本是2018.6,与3.6.3版本不匹配,bin包里有apache-maven3.3.9版本,匹配2018.6版本

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值