自主项目(小说网站)-8月16号

1、使用idea软件创建项目

        导入依赖:

        导入jsp依赖:

        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <scope>provided</scope>
        </dependency>
         <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
            <scope>provided</scope>
        </dependency>

        

         导入切面编程aop依赖:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>

        

2、配置maven打包web目录(写在pom.xml的build标签中,把plugins折叠起来,写在plugins后面)

        <resources>
            <resource>
                <directory>src/main/web</directory>
                <targetPath>META-INF/resources</targetPath>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.xml</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>

3、配置jsp文件的前缀和后缀(写在resources/application.properties配置文件中)

spring.mvc.view.prefix=/jsp/
spring.mvc.view.suffix=.jsp

4、对application.properties进行修改

5、手动添加web目录

        

        在项目名后面添加src\main\ 

6、启动类添加方法

7、写好实体类、mapper接口、service接口、service接口的实现类serviceImpl、最后在测试类中写入插入方法。

测试类

8、page主页编写与遇到的问题

        

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值