Can view the tutorials best in Google Chrome, Mozilla Firefox, Opera, higher version of Internet Explorer

RegularExpressionMethodPointcut Class In Spring AOP

Spring » On Sep 21, 2012 By Sivateja

RegularExpressionMethodPointcut class is going to verify whether the method name of the class is matching with the given regular expression or not.  If matches then those methods are eligible to get Advices.  While configuring these classes into xml file, we are going to configure any one of following 2 properties..

  • pattern
  • patterns

some thing…

According to above configuration, a method name should start with get, and between get and letter N there should be one or more characters and finally that should end with a digit.  If method name satisfies this pattern then it is eligible for getting advices.

While working with regular expressions, we have following indications..
  – matches for single character
.* – matches for zero [or] more characters
.+ – matches for 1 [or] more characters
.? – matches for zero [or] 1 character
[A-Z] – matches for an upper case alphabet
[abc] – matches for either a or b or c
[0-9] – matches for a digit

If we want to configure multiple regular expressions then we need to configure patterns property with list as NameMatchMethodPointcut, will see the example in the next article.

By [ Java/J2EE Developer & Web Designer ]
Founder of - Indian, lives in United States. You can contact me at


3 Responses to “RegularExpressionMethodPointcut Class In Spring AOP”
  1. sridhar says:

    Thanks to java4s for giving the wonderful tutorial.But where is the rest of the topics in Spring AOP i.e., Dynamic PointCut etc..???Am excepting you to finish this AOP Tutorial ASAP.

  2. debasish says:

    Where is the rest of the part….it is really good..but need to complete rest of the topic with detailed example and explanation

  3. prasad says:

    good website.
    please post dynamic pointcut in aop of spring framework


By posting your answer, you agree to our comments policy.
Most Recent Tutorials
Hibernate Recent Posts
Spring Recent Posts
Struts Recent Posts
Recomandded Links Current & UpComing Tutorials
Tutorials Online :
spring Hibernate struts Json Ajax Log4j Log4j
coreJava Servlets

UpComing :
JSP, Web Services [ In Progress ]
Java4s is optimized for learning java technologies, all the examples in this site are constantly reviewed to avoid errors. While using this site you agree to have read and accepted our terms of use and privacy policy
Especially i have prepared this blog by keeping fresher's in mind, however it will be very useful for real time developers too.

© 2014 Java4s All rights reserved. | strPro4Tut v(2.0) Theme designed by Team Java4s.