Actually to make things more clear i will include the appcontext.xml and the aspect class that i wrote
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd"
xmlns:aop="http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd"
default-autowire="byName">
and the other entry
<aop:aspectj-autoproxy />
<!-- <bean id="loggerProxy" class="org.springframework.aop.aspectj.annotation.AnnotationAwareAspectJAutoProxyCreator" /> -->
<bean id="sampleAspectj" class="com.cvs.esps.aspect.logging.TestAspect"/>
AND THE ASPECT CLASS
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
@Aspect
public class TestAspect {
@Pointcut("execution(* getPatientDataJSON(..))")
public void logTestMessage(){}
@Before("com.cvs.esps.service.patient.PatientServiceImpl.doPostGetPatientDataJSON(..)")
public void sayHelloBefore(){
System.out.println("*********************************************hello before");
}
@After("com.cvs.esps.service.patient.PatientServiceImpl.doPostGetPatientDataJSON(..)")
public void sayHelloAfter(){
System.out.println("*********************************************hello after");
}
}