spring - Before pointcut on HttpServletResponse sendRedirect compiling but not firing -



spring - Before pointcut on HttpServletResponse sendRedirect compiling but not firing -

i'm trying add together pointcut around calls httpservletresponse.sendredirect (api doc http://docs.oracle.com/javaee/6/api/javax/servlet/http/httpservletresponse.html) using aspectj , spring aop. code class , pointcut follows:

@aspect @log4j class exampleaspect { @before("execution(* javax.servlet.http.httpservletresponse.sendredirect(..))") void logredirectbeforesending() { log.warn('holy cow batman, redirect!') } }

currently although above code compiles doesn't ever execute (as evidenced lack of warn output in log , debug breakpoints in advice code never beingness hit).

although i've omitted them here sake of simplicity aspect contains other pointcuts correctly fire have ruled out aspect configuration potential cause (which why not including spring bean configuration).

further, have double checked via debugging class implements httpservletresponse.sendredirect() beingness called when i'm testing pointcut (if helps, 1 of implementing classes beingness called org.apache.catalina.connector.response https://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/connector/response.html).

is there i'm missing in pointcut definition that's required when defining pointcut around interface? best tell spring aop documentation shouldn't require special syntax.

i've been playing around variations in pointcut definition haven't had luck yet.

all in i'm stumped, ideas?

i expect response object not coming spring application context , such not subject aspect.

it doesn't matter phone call beingness initiated spring bean. matters phone call beingness invoked on spring bean. if illustration wrote point cutting applied append method in stringbuffer , did new stringbuffer().append('something'), point cutting not applied because stringbuffer interacting not spring bean. don't know how app set unless response coming out of spring context, don't expect point cutting applied.

spring groovy aop aspectj pointcut

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -