讲解SSM的xml文件

🏷️ 365bet官网多少 ⏱️ 2025-08-26 16:00:24 👨‍🔧 admin 👁️ 436 ⚡ 836
讲解SSM的xml文件

概述:这些配置文件很烦,建议直接复制粘贴

springMVC.xml文件

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"

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">

applicationContext.xml

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:context="http://www.springframework.org/schema/context"

xmlns:tx="http://www.springframework.org/schema/tx"

xmlns:aop="http://www.springframework.org/schema/aop"

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/tx

http://www.springframework.org/schema/tx/spring-tx.xsd

http://www.springframework.org/schema/aop

http://www.springframework.org/schema/aop/spring-aop.xsd">

init-method="init" destroy-method="close">

在这个文件中就已经配置了sqlSessionFactory、MapperScannerConfigurer 。

一个用来与数据库进行交互的,一个用来扫描包的。

项目结构:

然后配置一下jdbc.properties

druid.driverClassName=com.mysql.cj.jdbc.Driver

druid.url=jdbc:mysql://127.0.0.1:3306/cyl?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTC

druid.username=root

druid.password=123456

druid.initialSize=10

druid.minIdle=6

druid.maxActive=50

druid.maxWait=60000

pom依赖:

junit

junit

4.12

test

org.mybatis.generator

mybatis-generator-core

1.3.7

org.mybatis

mybatis

3.4.6

org.slf4j

slf4j-log4j12

1.7.21

mysql

mysql-connector-java

8.0.27

junit

junit

4.12

org.springframework

spring-beans

4.3.13.RELEASE

org.springframework

spring-core

4.3.13.RELEASE

org.springframework

spring-context

4.3.13.RELEASE

org.springframework

spring-expression

4.3.13.RELEASE

org.springframework

spring-tx

4.3.13.RELEASE

org.springframework

spring-jdbc

4.3.13.RELEASE

mysql

mysql-connector-java

8.0.27

com.alibaba

druid

1.0.29

org.mybatis

mybatis

3.4.6

org.mybatis

mybatis-spring

1.3.2

org.springframework

spring-aspects

4.3.13.RELEASE

aopalliance

aopalliance

1.0

org.springframework

spring-webmvc

4.3.13.RELEASE

org.springframework

spring-web

4.3.13.RELEASE

javax.servlet

javax.servlet-api

3.1.0

javax.servlet.jsp

jsp-api

2.2

javax.servlet

jstl

1.2

org.springframework

spring-test

4.3.13.RELEASE

junit

junit

4.12

org.mybatis.generator

mybatis-generator-core

1.3.7

org.slf4j

slf4j-log4j12

1.7.21

com.fasterxml.jackson.core

jackson-databind

2.8.9

com.fasterxml.jackson.core

jackson-databind

2.8.9

com.fasterxml.jackson.core

jackson-core

2.8.9

com.alibaba

fastjson

1.2.34

相关资讯

还需查看杭州叙简科技有限公司更多信息?
365bet进不去

还需查看杭州叙简科技有限公司更多信息?

📅 06-29 🔧 admin
学化妆培训班不退费该怎么办?
365bet官网多少

学化妆培训班不退费该怎么办?

📅 08-19 🔧 admin
逆水寒哪些奇遇加属性 逆水寒加属性奇遇汇总
365bet官网多少

逆水寒哪些奇遇加属性 逆水寒加属性奇遇汇总

📅 08-23 🔧 admin