当前位置: 首页 > news >正文

网站备案域名更改公司如何做营销推广

网站备案域名更改公司,如何做营销推广,开发软件的网站,中韩双语网站制作价格此段小代码演示了spring aop中Around Before After三个注解的区别 Before是在所拦截方法执行之前执行一段逻辑。 After 是在所拦截方法执行之后执行一段逻辑。 Around是可以同时在所拦截方法的前后执行一段逻辑。 package com.itsoft.action;import org.springframework.contex…

此段小代码演示了spring aop中@Around @Before @After三个注解的区别

@Before是在所拦截方法执行之前执行一段逻辑。

@After 是在所拦截方法执行之后执行一段逻辑。

@Around是可以同时在所拦截方法的前后执行一段逻辑。

package com.itsoft.action;import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Controller;/*** * @author zxf* 演示aop测试类*/
@Controller
public class UserAction {public void queryUsers(){System.out.println("查询所有用户【all users list】");}public static void main(String[] args) {ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("application-aop.xml");UserAction userAction = (UserAction)ctx.getBean("userAction");userAction.queryUsers();ctx.destroy();}
}
package com.itsoft;import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;/*** * @author Administrator* 通过aop拦截后执行具体操作*/
@Aspect
@Component
public class LogIntercept {@Pointcut("execution(public * com.itsoft.action..*.*(..))")public void recordLog(){}@Before("recordLog()")public void before() {this.printLog("已经记录下操作日志@Before 方法执行前");}@Around("recordLog()")public void around(ProceedingJoinPoint pjp) throws Throwable{this.printLog("已经记录下操作日志@Around 方法执行前");pjp.proceed();this.printLog("已经记录下操作日志@Around 方法执行后");}@After("recordLog()")public void after() {this.printLog("已经记录下操作日志@After 方法执行后");}private void printLog(String str){System.out.println(str);}
}

演示@Around @Before @After 区别

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:context="http://www.springframework.org/schema/context"xsi:schemaLocation="http://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.0.xsdhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"><context:annotation-config /><context:component-scan base-package="com.itsoft"/><aop:aspectj-autoproxy />
</beans>

 

转载于:https://www.cnblogs.com/toSeeMyDream/p/4372280.html

http://www.lbrq.cn/news/2419327.html

相关文章:

  • 湖南茶叶网站建设官网seo哪家公司好
  • 2019做地方门户网站自媒体代运营
  • 山东做网站建设的好公司哪家好谷歌seo是什么
  • 福田附近做网站公司免费的网络推广有哪些
  • 酒店旅游团购网站建设近期国内外重大新闻10条
  • 网站功能图志鸿优化网下载
  • 网站公众号小程序开发公司网络推广策划方案模板
  • 网站如何做宣传nba篮网最新消息
  • 简约好看的网站模板免费下载网络舆情分析报告范文
  • 重庆环保公司网站建设镇江百度推广公司
  • 文化投资的微网站怎么做怎样推广品牌
  • 遵义网站开发自媒体推广渠道
  • 做网站西宁360网址大全
  • 网站咋做推广深圳seo优化排名
  • 网站建设邮win7最好的优化软件
  • 宁波网站建设培训西安关键词快速排名
  • 建设工程网站广州自己怎么制作网页
  • 佛山高端外贸网站建设关键词自动生成器
  • 做的网站放在阿里云微信营销的案例
  • 闵行区网站制作网页设计流程步骤
  • 虹桥做网站域名权重是什么意思
  • 定制营销的优缺点网站seo排名优化方法
  • 网站的要素是什么意思站长工具ip地址查询
  • wordpress评论软件快手seo软件下载
  • 网站建设 文档下载西安seo技术
  • mip网站建设河北疫情最新情况
  • 手机什么app做网站日本域名注册网站
  • 杰奇网站地图插件新站seo快速排名 排名
  • 网站哪家好湛江百度seo公司
  • seo优化厂家网络优化网站
  • 易语言+懒人精灵/按键中控群控教程(手机、主板机、模拟器通用)
  • A316-Mini-V1:超小尺寸USB高清音频解码器模组技术探析
  • InfluxDB 核心概念与发展历程全景解读(二)
  • 最大子数组和问题-详解Kadane算法
  • 【AI】文生图文生视频
  • 周末总结(2024/07/19)