0
0
Spring Bootframework~10 mins

Pointcut expressions 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 match all methods in the service package.

Spring Boot
execution(* com.example.service..*[1]*(..))
Drag options to blanks, or click blank then click option'
Aset
Bget
C*
Dfind
Attempts:
3 left
💡 Hint
Common Mistakes
Using a specific method name instead of a wildcard.
Omitting the wildcard causes no methods to match.
2fill in blank
medium

Complete the code to match all public methods in any class.

Spring Boot
execution(public [1] *(..))
Drag options to blanks, or click blank then click option'
AString
B*
Cint
Dvoid
Attempts:
3 left
💡 Hint
Common Mistakes
Specifying a return type limits matched methods.
Using a specific type misses other methods.
3fill in blank
hard

Fix the error in the pointcut to match all methods in classes ending with 'Controller'.

Spring Boot
execution(* *[1]Controller.*(..))
Drag options to blanks, or click blank then click option'
A*
B.
C..
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using '.' matches only one character, not any prefix.
Using '..' is for packages, not class names.
4fill in blank
hard

Fill both blanks to match all methods in the repository package with any return type.

Spring Boot
execution([1] com.example.repository..[2]*(..))
Drag options to blanks, or click blank then click option'
A*
Bpublic
Dprivate
Attempts:
3 left
💡 Hint
Common Mistakes
Using specific return types limits matches.
Using access modifiers restricts methods unnecessarily.
5fill in blank
hard

Fill all three blanks to match any public method in classes under service package with names starting with 'save'.

Spring Boot
execution([1] [2].service..[3]save*(..))
Drag options to blanks, or click blank then click option'
Apublic
Bcom.example
C*
Dprivate
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong access modifier restricts matches.
Incorrect package name causes no matches.
Missing wildcard before 'save' limits class matches.