国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

網(wǎng)站開發(fā)的形式是app營銷

網(wǎng)站開發(fā)的形式是,app營銷,武漢注冊公司地址,phpcms 移動網(wǎng)站模板概念解釋:(理解基本概念方可快速入手) 連接點(diǎn)(joinpoint) 被攔截到的點(diǎn),因?yàn)镾pring只支持方法類型的連接點(diǎn),所以在Spring中連接點(diǎn)指的就是被攔截到的方法。 切入點(diǎn)(pointcut&#x…

?概念解釋:(理解基本概念方可快速入手)

  1. 連接點(diǎn)(joinpoint)

    被攔截到的點(diǎn),因?yàn)镾pring只支持方法類型的連接點(diǎn),所以在Spring中連接點(diǎn)指的就是被攔截到的方法。

  2. 切入點(diǎn)(pointcut)

    切入點(diǎn)是指我們要對哪些連接點(diǎn)進(jìn)行攔截的定義

  3. 通知(advice)

    所謂通知指的就是指攔截到連接點(diǎn)之后要執(zhí)行的代碼,通知分為前置、后置、異常、最終、環(huán)繞通知五類

  4. 切面(aspect)

    是切入點(diǎn)和通知的結(jié)合

?通知順序:

前置通知:aop:before
??????????? 后置通知:aop:after-returning【try】
??????????? 最終通知:aop:after【finally】
??????????? 異常通知:aop:after-throwing【catch】
??????????? 環(huán)繞通知:aop:around


??????????? try{
??????????????? ...
??????????????? return aop:after-returning
??????????? }catch(Exception e){
??????????????? ...
??????????????? aop:after-throwing
??????????? }finally{
??????????????? ...
??????????????? aop:after
??????????? }

切點(diǎn)表達(dá)式:
??????? 格式:execution([修飾符] 返回值 報名.類名.方法名(參數(shù)))
??????? eg:execution(* com.by.service.*.*(..))

?實(shí)例演示:

pom.xml:

<dependencies><!--ioc--><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>6.0.12</version></dependency><!--支持切點(diǎn)表達(dá)式AOP --><dependency><groupId>org.springframework</groupId><artifactId>spring-aspects</artifactId><version>5.1.8.RELEASE</version></dependency><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-log4j12</artifactId><version>1.7.19</version></dependency></dependencies>

UserDaoImpl:

package com.by.dao;public class UserDaoImpl implements UserDao {@Overridepublic void addUser(){System.out.println("insert into tb_user......");}
}

UserServiceImpl:

package com.by.service;import com.by.dao.UserDao;public class UserServiceImpl implements UserService {private UserDao userDao;public void setUserDao(UserDao userDao) {this.userDao = userDao;}@Overridepublic void addUser(){userDao.addUser();System.out.println(8/0);}
}

MyLogActive:(增強(qiáng)類)

/** Copyright (c) 2020, 2024,  All rights reserved.**/
package com.by.advice;import org.aspectj.lang.ProceedingJoinPoint;/*** <p>Project: Spring - MyLogAdvice</p>* <p>Powered by scl On 2024-01-05 15:04:11</p>* <p>描述:<p>** @author 孫臣龍 [1846080280@qq.com]* @version 1.0* @since 17*/
public class MyLogAdvice {public void after() {System.out.println("最終通知、、、");}public void before() {System.out.println("前置通知、。、");}public void afterReturn(){System.out.println("后置通知");}public void afterThrowing(){System.out.println("異常通知");}public void around(ProceedingJoinPoint joinPoint) {try {System.out.println("前環(huán)繞通知。。。");joinPoint.proceed();System.out.println("后環(huán)繞通知。。。");} catch (Throwable e) {throw new RuntimeException(e);}}
}

?applicationContext.xml:

<?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"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop.xsd"><bean id="userDao" class="com.by.dao.UserDaoImpl"></bean><bean id="userService" class="com.by.service.UserServiceImpl"><property name="userDao" ref="userDao"></property></bean><!--增強(qiáng)--><bean id="myLogAdvice" class="com.by.advice.MyLogAdvice"></bean><!--aop--><aop:config><!--切點(diǎn)--><aop:pointcut id="pointcut" expression="execution(* com.by.service.*.*(..))"/><!--切面--><aop:aspect ref="myLogAdvice"><aop:before method="before" pointcut-ref="pointcut"></aop:before><aop:after method="after" pointcut-ref="pointcut"></aop:after><aop:around method="around" pointcut-ref="pointcut"></aop:around><aop:after-returning method="afterReturn" pointcut-ref="pointcut"></aop:after-returning><aop:after-throwing method="afterThrowing" pointcut-ref="pointcut"></aop:after-throwing></aop:aspect></aop:config></beans>

沒增強(qiáng)前結(jié)果展示:

增強(qiáng)之后結(jié)果展示:

http://aloenet.com.cn/news/32587.html

相關(guān)文章:

  • 公司商標(biāo)設(shè)計網(wǎng)站seo快速排名軟件方案
  • 淘客網(wǎng)站開發(fā)公司優(yōu)化近義詞
  • 動態(tài)網(wǎng)站建設(shè)與維護(hù)唯尚廣告聯(lián)盟平臺
  • 支持api網(wǎng)站開發(fā)seo推廣灰色詞
  • 企業(yè)建立一個網(wǎng)站步驟百度推廣登錄網(wǎng)站
  • 專業(yè)做化妝品外包材的招聘網(wǎng)站seo技術(shù)團(tuán)隊(duì)
  • 做網(wǎng)站 用什么建站軟件好論壇推廣方案
  • 怎么補(bǔ)網(wǎng)站漏洞網(wǎng)絡(luò)營銷名詞解釋答案
  • 如何建立一個網(wǎng)站支持chrome網(wǎng)絡(luò)推廣靠譜嗎
  • 網(wǎng)站建設(shè)收費(fèi)價目表制作網(wǎng)頁的流程步驟
  • 廊坊電商網(wǎng)站建設(shè)2022年最火的關(guān)鍵詞
  • 武漢金佳言網(wǎng)站建設(shè)免費(fèi)建站的網(wǎng)站有哪些
  • 我們做網(wǎng)站 出教材 辦育心經(jīng)武漢競價托管公司
  • 無代碼做網(wǎng)站seo教程培訓(xùn)班
  • 甌北網(wǎng)站制作百度影響力排名順序
  • 網(wǎng)站建設(shè)與維護(hù)超級外鏈吧外鏈代發(fā)
  • 網(wǎng)站建設(shè)期末實(shí)踐報告網(wǎng)絡(luò)輿情監(jiān)測
  • 華為云速建站可以做英文網(wǎng)站百度怎么做自己的網(wǎng)頁
  • wordpress數(shù)據(jù)查詢?nèi)绾蝺?yōu)化關(guān)鍵詞搜索
  • 視頻當(dāng)背景圖片 網(wǎng)站開發(fā)企業(yè)文化培訓(xùn)
  • 怎么在網(wǎng)站里做網(wǎng)頁免費(fèi)網(wǎng)絡(luò)營銷推廣軟件
  • 做網(wǎng)站的公司中國聯(lián)通業(yè)績
  • 網(wǎng)頁制作素材按鈕圖標(biāo)seo編輯招聘
  • 做服裝要看國外哪些網(wǎng)站長尾關(guān)鍵詞挖掘
  • 兩學(xué)一做材料上哪個網(wǎng)站找最佳的搜索引擎
  • 可以自己做網(wǎng)站優(yōu)化嗎體驗(yàn)式營銷經(jīng)典案例
  • 門戶網(wǎng)站建設(shè)談判搜狗站長平臺主動提交
  • 網(wǎng)站開發(fā)的具體流程網(wǎng)站發(fā)布平臺
  • 西寧網(wǎng)站seo公司seo推廣效果
  • 國內(nèi)頂尖網(wǎng)站設(shè)計公司口碑營銷的定義