[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] aspects in jsp

hi
I have a db connection aspect defined, that connects to a database before any method of that class is called, and disconnects after the method's execution. it works fine when i test it by invoking the method through my test class. however, when i invoke the method from jsps the before advice is not called.
> I have another aspect defined traceAspect defined for logging purposes. it works fine, since it is only printing. Whereas, the dbconnect aspect accesses a member and initializes it, which is then used by the invoked method.this member is not initialized and is null. 
I am sending the code, hope it helps in understanding my problem.
 
public aspect DbConnectAspect
{
  poincut connect(DbConnection con): call (* DbConnection *.*(..)) && target(con) && 
                                         !within(DbConnectAspect);
 
before(DbConnection con): connect(con)
{
   con.connect();//where connect is a method defined in class DbConnection, and it creates a connection, and initilaizes the Connection varialble that is a meember of the con object.
}
 
}
 
 I will be really grateful if anyone of you can help me with this. 
 
thankyou
Hinna

<<winmail.dat>>