Hello,
  I'm using AspectJ capabilities on my web application on Eclipse. I want to
add logging functionality. Concretelly, I've created a ControllerServlet
that receive all user requests and I want write or log this user actions in
my log file. So,  I've added a aspect that does it:

package com.gmsoft.aspects;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public aspect LogAspect {
        pointcut doPostMethod (com.gmsoft.ControllerServlet controller,
HttpServletRequest request, HttpServletResponse response) : call (void
doPost(HttpServletRequest, HttpServletResponse)) && target(controller) &&
args(request,response);
        
        before (com.gmsoft.ControllerServlet controller, HttpServletRequest
request, HttpServletResponse response) :
doPostMethod(controller,request,response) {
                System.out.println(request.getAttribute("action").toString);
        }
}

I think that I must modify web.xml configuration file to achieve Tomcat
works with Aspects.

Can you help me How I can do it?

Note: In my code I only use Aspects insede Servlets, so I don't use Aspects
inside JSP. I say it for help you if is necessary.

Thanks in advance.
-- 
View this message in context: 
http://www.nabble.com/AspectJ-with-Tomcat-tf2136440.html#a5895777
Sent from the Tomcat - User forum at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to