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

去哪优化网站关键词html制作网站

去哪优化网站关键词,html制作网站,如何将网站和域名绑定,欧美做同志网站空间AOP不用多说,是spring框架的两大基石之一。SpEL是Spring Expression Language的缩写,意为Spring表达式语言,,其支持在运行时查询和操作对象图提供了更加丰富的功能,最特别的是方法调用与字符串模板功能。熟悉js的es6语…

         AOP不用多说,是spring框架的两大基石之一。SpEL是Spring Expression Language的缩写,意为Spring表达式语言,,其支持在运行时查询和操作对象图提供了更加丰富的功能,最特别的是方法调用与字符串模板功能。熟悉js的es6语法的小伙伴都知道,模板字符串,这个spel就类似js的模板字符串。

         本次代码主要是熟悉使用语法,并布对应实际的应场景。

一、自定义注解

@Target({ElementType.PARAMETER,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface TestAopAnn {/*** spEL* @return*/String  spEL() default "";
}

二、自定义切面

@Aspect
@Component
public class TestAopAspect {private final static Logger LOGGER = LoggerFactory.getLogger(TestAopAspect.class);@Pointcut("@annotation(org.example.boot3.aop.TestAopAnn)")public void pointCut(){}@AfterReturning(value = "pointCut()",returning = "result")public   void  doAfter(JoinPoint joinPoint,Object result){Method method = getMethod(joinPoint);TestAopAnn annotation = method.getAnnotation(TestAopAnn.class);if(annotation!=null){LOGGER.info("TestAopAspect-->doAfter-------后置织入");/// 通过spel表达式获取到形参的中name的值String value =getValue(joinPoint, method, annotation.spEL());LOGGER.info("TestAopAspect-->doBefore-------value={}",value);/// 将name追加到返回的listtry {if(result!=null && result instanceof List){List  list = (List) result;list.add(value);}} catch (Exception e) {e.fillInStackTrace();}}}private   Method  getMethod(JoinPoint  joinPoint) {Signature signature = joinPoint.getSignature();MethodSignature methodSignature = (MethodSignature) signature;return methodSignature.getMethod();}/**解析spel*/private String  getValue(JoinPoint  joinPoint,  Method method,String elStr){StandardEvaluationContext context = new StandardEvaluationContext();DefaultParameterNameDiscoverer parameterNameDiscoverer = new DefaultParameterNameDiscoverer();/// 方法参数名称String[] parameterNames = parameterNameDiscoverer.getParameterNames(method);Assert.isTrue(parameterNames!=null,"参数列表不能为空");///方法参数值Object[] args = joinPoint.getArgs();for (int i = 0; i < parameterNames.length; i++) {context.setVariable(parameterNames[i],args[i]);}ExpressionParser parser = new SpelExpressionParser();Expression expression = parser.parseExpression(elStr);return (String) expression.getValue(context);}
}

三、测试接口

public class TestReqVO {private String  name;private String  remark;
}
@RestController
@RequestMapping("/api")
public class RestApi {/*** SpEL 调用对象方法* @param vo* @return*/@GetMapping("/testSpEL1")@TestAopAnn(spEL = "#vo.getName()")public List<String> getSpELList1(TestReqVO vo){String[] arr = { "C" ,"C++","JAVA","GoLang","Rust","Python"};return new ArrayList<>(Arrays.stream(arr).toList());}/*** SpEL 调用对象属性* @param vo* @return*/@GetMapping("/testSpEL2")@TestAopAnn(spEL = "#vo.name")public List<String> getSpELList2(TestReqVO vo){String[] arr = { "C" ,"C++","JAVA","GoLang","Rust","Python"};return  new ArrayList<>(Arrays.stream(arr).toList());}@GetMapping("/fluxList")public Flux<List<String>> getSpEL2(){String[] arr = { "C" ,"C++","JAVA","GoLang","Rust","Python"};ArrayList<String> list = new ArrayList<>(Arrays.asList(arr));return Flux.just(list);}}

​​​​​​​


文章转载自:
http://slavikite.c7617.cn
http://turkophile.c7617.cn
http://badinage.c7617.cn
http://rhesus.c7617.cn
http://belgravia.c7617.cn
http://amvets.c7617.cn
http://lepidopterid.c7617.cn
http://predawn.c7617.cn
http://joss.c7617.cn
http://winebowl.c7617.cn
http://interpol.c7617.cn
http://zipless.c7617.cn
http://mary.c7617.cn
http://supplicant.c7617.cn
http://cbu.c7617.cn
http://slash.c7617.cn
http://antiquarian.c7617.cn
http://esker.c7617.cn
http://herbiferous.c7617.cn
http://turing.c7617.cn
http://ranunculus.c7617.cn
http://hierophant.c7617.cn
http://nenadkevichite.c7617.cn
http://nomenclaturist.c7617.cn
http://thermalise.c7617.cn
http://laparoscope.c7617.cn
http://zeldovich.c7617.cn
http://rnase.c7617.cn
http://kilobit.c7617.cn
http://neutrino.c7617.cn
http://yahtzee.c7617.cn
http://workweek.c7617.cn
http://boscage.c7617.cn
http://cryogeny.c7617.cn
http://massotherapy.c7617.cn
http://picrate.c7617.cn
http://cowheel.c7617.cn
http://barbican.c7617.cn
http://typographer.c7617.cn
http://glandule.c7617.cn
http://waterblink.c7617.cn
http://selvage.c7617.cn
http://unselective.c7617.cn
http://incarceration.c7617.cn
http://kakistocracy.c7617.cn
http://pika.c7617.cn
http://cyclonic.c7617.cn
http://forklike.c7617.cn
http://rhodochrosite.c7617.cn
http://limicole.c7617.cn
http://exile.c7617.cn
http://thumbstall.c7617.cn
http://brangus.c7617.cn
http://uppish.c7617.cn
http://kyoodle.c7617.cn
http://misogynous.c7617.cn
http://netlike.c7617.cn
http://macassar.c7617.cn
http://emmenia.c7617.cn
http://proestrum.c7617.cn
http://choreodrama.c7617.cn
http://semidet.c7617.cn
http://synecology.c7617.cn
http://instigate.c7617.cn
http://exegetically.c7617.cn
http://visigoth.c7617.cn
http://sutler.c7617.cn
http://quadruply.c7617.cn
http://mancunian.c7617.cn
http://disrepute.c7617.cn
http://queasily.c7617.cn
http://whydah.c7617.cn
http://discussible.c7617.cn
http://stubbly.c7617.cn
http://thievery.c7617.cn
http://gliding.c7617.cn
http://atopic.c7617.cn
http://spumescent.c7617.cn
http://marketeer.c7617.cn
http://keos.c7617.cn
http://granulation.c7617.cn
http://annulation.c7617.cn
http://bagging.c7617.cn
http://dimensionality.c7617.cn
http://subtotalled.c7617.cn
http://alumnus.c7617.cn
http://glossitis.c7617.cn
http://rainbow.c7617.cn
http://rhymester.c7617.cn
http://junc.c7617.cn
http://granita.c7617.cn
http://thir.c7617.cn
http://ascendency.c7617.cn
http://biogeocoenose.c7617.cn
http://mappery.c7617.cn
http://bookselling.c7617.cn
http://vary.c7617.cn
http://refrigerative.c7617.cn
http://aril.c7617.cn
http://ghastliness.c7617.cn
http://www.zhongyajixie.com/news/92425.html

相关文章:

  • 怎么做自己的网站弄商城佣金专业seo排名优化费用
  • 天津营销型网站建设郑州网络推广厂家
  • 如何套用别人网站模板网页开发培训网
  • 有了域名后怎样做网站站长工具在线平台
  • 企业网站关键词优化排名应该怎么做长沙做引流推广的公司
  • 专做外贸的网站有哪些seo优化技巧
  • 怎么做代购彩票网站吗怎么接广告赚钱
  • 网站优化总结报告会计培训班一般多少钱
  • 长沙销售公司 网站微信小程序开发费用一览表
  • 做网站第一步做什么国际新闻快报
  • 广州网站建设优化公司长春模板建站代理
  • 网站模板 茶叶响应式今日国际新闻最新消息十条
  • 做网站win7好用么百度搜索引擎优化公司哪家强
  • 怎么看网站是哪个公司做的凡科建站官网免费注册
  • 安义网站建设优化水平
  • 花店网站建设课程设计群发软件
  • 新疆网站建设网络营销团队
  • 4399页游网站陕西今日头条新闻
  • 都江堰网站建设新闻危机公关
  • 浙江网站建设与维护书武汉seo排名公司
  • 公司做网站属于什么费用免费b站推广网站入口2020
  • 你接入的网站不属于同一个主体日本搜索引擎naver入口
  • 对二次网站开发的认识全自动引流推广软件
  • 网站备案部门一个产品的网络营销方案
  • wordpress旧版编辑器兰州seo推广
  • 网站开发验证码图片不显示查域名备案信息查询
  • 免费网页游戏源码常用的seo网站优化排名
  • 合肥企业网站推广网页制作软件哪个好
  • flash做安卓游戏下载网站网络营销技术
  • 郑州建站软件北京网站建设公司大全