in Education by
I have an aspect advice like following @AfterReturning("execution(* de.ojk.platform.servicelayer.session.SessionService.getAttribute(..))") public void fixUrl() .... getAttribute method accepts only one String parameter. what I would like to do, I want "fixUrl" to be executed only when 'name' string is given as parameter. "getAttribute('name')". How can I do that? Thanks! JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
@AfterReturning(value = "execution(* de.ojk.platform.servicelayer.session.SessionService.getAttribute(..)) && args(String)") public void after1(JoinPoint jp){ System.out.println(jp.getArgs()[0]); System.out.println("after Return:"+jp.getSignature()); } Above Way Can work. If you want support other type except String ,change String to what you want . jp.getArgs()[0] get the variable! The below Way you can try , i try it successfully in my code! @AfterReturning(value = "execution(@AfterReturning(value = "execution(* de.ojk.platform.servicelayer.session.SessionService.getAttribute(..)) && args(a)") public void after2(JoinPoint jp,String a){ System.out.println(a); System.out.println("after Return:"+jp.getSignature()); }

Related questions

0 votes
    What is Aspect oriented programming(AOP)?...
asked Nov 7, 2020 in Technology by JackTerrance
0 votes
    I am new to Spring AOP. Using annotation based Spring configuration: @Configuration @EnableAspectJAutoProxy( ... Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    I have been able to define multiple aspects (one is @Before and another is @Around) using Spring AOP ( ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 18, 2022 in Education by JackTerrance
+1 vote
    What AOP stands for in Spring? A - Aspect Oriented Programming B - Any Object Programming C - Asset Oriented Programming D - Asset Oriented Protocol...
asked Oct 14, 2020 in Technology by JackTerrance
0 votes
    I wanted to try the Spring 3.1 Cache Abstraction, annotating some methods with @Cachable. This is working ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 7, 2022 in Education by JackTerrance
0 votes
    I wanted to try the Spring 3.1 Cache Abstraction, annotating some methods with @Cachable. This is working ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    I am implementing a display algorithm where we can have multiple layers of windows based on their z-order i ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
0 votes
    I am implementing a display algorithm where we can have multiple layers of windows based on their z-order i ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I am implementing a display algorithm where we can have multiple layers of windows based on their z-order i ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 27, 2022 in Education by JackTerrance
0 votes
    I have quite a large code base using a variety of different ADO technologies (i.e. some EF and in ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 26, 2022 in Education by JackTerrance
0 votes
    I am using spring boot command line runner app, it hangs at PostGIS dialect, the below stack trace contains ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    The is an important aspect of India’s foreign policy ...... (a) free economic policy (b) interdependence (c) non-alignment (d) nuclear development Please answer the above question....
asked Aug 20, 2022 in Education by JackTerrance
0 votes
    State the appropriate concept for the given statement. The aspect of liberty is expressed by Berlin’s statement “I am my own master”. Please answer the above question....
asked Aug 3, 2022 in Education by JackTerrance
0 votes
    Im trying to make a drawable xml resource to use as background for an activity. The background need to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    Im trying to make a drawable xml resource to use as background for an activity. The background need to ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
...