摘要:
Qualifier注解的意思是合格者,通过这个标示,表明了哪个实现类才是我们所需要的,添加@Qualifier注解,需要注意的是@Qualifier的参数名称为我们之前定义@Service注解的名
阅读全文
posted @ 2022-03-15 09:49
微笑阿凡达
阅读(13)
推荐(0)
摘要:
1.先添加web支持 2.添加web.xml依赖 <!-- DispatchServlet--> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.Dispa
阅读全文
posted @ 2022-03-15 08:51
微笑阿凡达
阅读(27)
推荐(0)
摘要:
1.先整合dao层 <!-- 1.关联数据库配置文件--> <context:property-placeholder location="classpath:database.properties"/><!-- 2.连接池 dbcp:半自动化操作,不能自动连接 c3p0:自动化操作(自动化的加载配
阅读全文
posted @ 2022-03-15 08:33
微笑阿凡达
阅读(68)
推荐(0)
摘要:
1.新建一个maven项目 2.配置依赖文件 3.配置静态导出问题依赖 <build> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include>
阅读全文
posted @ 2022-03-14 17:49
微笑阿凡达
阅读(56)
推荐(0)
摘要:
导入依赖包: <dependencies> <!-- https://mvnrepository.com/artifact/junit/junit --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <ve
阅读全文
posted @ 2022-03-14 17:43
微笑阿凡达
阅读(24)
推荐(0)
摘要:
@PathVariable 路径变量 过滤器配置: <filter> <filter-name>encoding</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-cl
阅读全文
posted @ 2022-03-14 15:41
微笑阿凡达
阅读(62)
推荐(0)
摘要:
web.xml依赖 <?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema
阅读全文
posted @ 2022-03-14 11:59
微笑阿凡达
阅读(28)
推荐(0)
摘要:
<!--处理器映射--> <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/><!--处理器适配器--> <bean class="org.springframework.web.servl
阅读全文
posted @ 2022-03-14 10:43
微笑阿凡达
阅读(22)
推荐(0)
摘要:
pom.xml依赖 <dependencies> <!-- https://mvnrepository.com/artifact/junit/junit --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId>
阅读全文
posted @ 2022-03-14 10:03
微笑阿凡达
阅读(116)
推荐(0)
摘要:
先配置事务才能进行bean的使用 为什么需要配置事务?、
阅读全文
posted @ 2022-03-13 16:09
微笑阿凡达
阅读(32)
推荐(0)