0
0
Spring Bootframework~10 mins

@Around advice for full control in Spring Boot - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define an @Around advice method signature.

Spring Boot
@Around("execution(* com.example.service.*.*(..))")
public Object [1](ProceedingJoinPoint joinPoint) throws Throwable {
    return joinPoint.proceed();
}
Drag options to blanks, or click blank then click option'
AaroundHandler
BaroundAdvice
ChandleAround
DadviceMethod
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid method names or missing the ProceedingJoinPoint parameter.
2fill in blank
medium

Complete the code to proceed with the original method execution inside @Around advice.

Spring Boot
Object result = joinPoint.[1]();
Drag options to blanks, or click blank then click option'
Aproceed
Bexecute
Crun
Dcall
Attempts:
3 left
💡 Hint
Common Mistakes
Using methods like 'execute' or 'run' which do not exist on ProceedingJoinPoint.
3fill in blank
hard

Fix the error in the @Around advice to correctly catch exceptions and rethrow them.

Spring Boot
try {
    Object result = joinPoint.[1]();
    return result;
} catch (Throwable e) {
    throw e;
}
Drag options to blanks, or click blank then click option'
Acall
Brun
Cproceed
Dexecute
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like 'run' or 'execute' causing compile errors.
4fill in blank
hard

Fill both blanks to log before and after the method execution in @Around advice.

Spring Boot
System.out.println("[1] method start");
Object result = joinPoint.[2]();
System.out.println("[1] method end");
return result;
Drag options to blanks, or click blank then click option'
AaroundAdvice
Bproceed
Cexecute
Dhandle
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong method names for logging or proceeding.
5fill in blank
hard

Fill all three blanks to modify the return value in @Around advice by appending a string.

Spring Boot
Object result = joinPoint.[1]();
if (result instanceof String) {
    result = ((String) result) [2] " - modified";
}
return [3];
Drag options to blanks, or click blank then click option'
Aproceed
B+
Cresult
Dconcat
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'concat' method incorrectly or returning the wrong variable.