2021年12月9日

springMvc - @PathVariable

摘要: @PathVariable:接收请求路径中占位符的值 @RequestMapping(value="/Test/{id}") public void Test(@PathVariable("id") Integer id){ ............. } 阅读全文

posted @ 2021-12-09 17:22 每天积极向上 阅读(25) 评论(0) 推荐(0) 编辑

SpringMvc - @RequestMapping属性详解

摘要: @Target({ElementType.METHOD, ElementType.TYPE}) // 可以在方法和类的声明中使用 @Retention(RetentionPolicy.RUNTIME) @Documented @Mapping public @interface RequestMap 阅读全文

posted @ 2021-12-09 17:09 每天积极向上 阅读(161) 评论(0) 推荐(0) 编辑

SpringMvc - springmvc-servlet.xml

摘要: springmvc-servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2 阅读全文

posted @ 2021-12-09 16:49 每天积极向上 阅读(33) 评论(0) 推荐(0) 编辑

SpringMvc - 目录

摘要: Spring MVC概述:Spring MVC是Spring提供的一个强大而灵活的web框架。借助于注解,Spring MVC提供了几乎是POJO的开发模式,使得控制器的开发和测试更加简单。这些控制器一般不直接处理请求,而是将其委托给Spring上下文中的其他bean,通过Spring的依赖注入功能 阅读全文

posted @ 2021-12-09 16:32 每天积极向上 阅读(122) 评论(0) 推荐(0) 编辑

SpringMvc - 导入的包以及配置文件

摘要: 1.要导入的包 pom.xml <!--版本控制--> <properties> <spring.version>5.3.13</spring.version> </properties> <dependencies> <!--spring mvc start--> <dependency> <gr 阅读全文

posted @ 2021-12-09 16:25 每天积极向上 阅读(417) 评论(0) 推荐(0) 编辑

2021年12月8日

Spring - 声明式事务 - 配置文件实现

摘要: application.xml <!--导入外部配置文件--> <context:property-placeholder location="jdbc.properties"/> <!--创建数据源--> <bean id="dataSource" class="com.mchange.v2.c3 阅读全文

posted @ 2021-12-08 17:49 每天积极向上 阅读(64) 评论(0) 推荐(0) 编辑

Spring - 声明式事务 - 注解实现

摘要: 1.配置文件 Application.xml <!--导入外部配置文件--> <context:property-placeholder location="jdbc.properties"/> <!--创建数据源--> <bean id="dataSource" class="com.mchang 阅读全文

posted @ 2021-12-08 17:38 每天积极向上 阅读(341) 评论(0) 推荐(0) 编辑

Spring - aop-配置文件实现

摘要: 1.增强类(通知 / 增强) public class MyBook { public void before1() { System.out.println("前置增强........"); } public void after1() { System.out.println("后置增强.... 阅读全文

posted @ 2021-12-08 16:37 每天积极向上 阅读(64) 评论(0) 推荐(0) 编辑

Spring - aop-注解实现

摘要: @Component @Aspect/*生成代理对象*/ @Order(0) public class LogProxy { @Pointcut(value="execution(* com.levi..*.*(..))") public void pointcut1(){} @Before("po 阅读全文

posted @ 2021-12-08 16:26 每天积极向上 阅读(41) 评论(0) 推荐(0) 编辑

Spring - 工厂Bean

摘要: 工厂Bean /*User工厂Bean*/ @Component public class UserFactory implements FactoryBean<User> { /*返回*/ public User getObject() throws Exception { User user=n 阅读全文

posted @ 2021-12-08 15:39 每天积极向上 阅读(11) 评论(0) 推荐(0) 编辑

导航