When using the service test class, you need to print information prompts in the console, and then use the controller layer to pay attention

1. The log4J file needs to be configured in mybatis.cfg.xml to ensure that the console prints information.

Configure log4j file information

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
  PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
  "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <settings>
        <setting name="logImpl" value="LOG4J2"/>
    </settings>
</configuration>

2. When calling the service method, the header of the implementation class of the service needs to be annotated and given parameters, so that the method can be found more accurately. If it is not added, the class name will be searched according to the type. The first letter is lower case.

3. When writing code, the added jar package cannot be repeated, and an error will be reported.

4. When loading configuration files, if you need to load multiple configuration files. need to be separated by commas.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325681080&siteId=291194637