Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Intercepting methods call in a web application  RSS feed

 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Not sure if this is the right forum to post this question.

I have a complex web application which is build on a proprietary framework.
I am trying to understand the execution flow when a html form is submitted.

I tried to use eclipse debugger to understand the execution flow but was too complicated for such a big application(how many breakpoints shd i put?).

What I want is to log all the method calls to a log file. For ex: the log file should look like:

Entering/Executing Class1.method1
Entering/Executing Class2.method2
Exiting Class2.method2
Exiting Class1.method1

I know we can do this with Spring AOP but we are not using spring.
How to achieve this with out using spring?

Thanks in advance,
Srikanth.
 
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Spring AOP is a subset of AspectJ, only the Spring AOP part requires Spring. AspectJ does not. So why not use AspectJ instead.

Mark
 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Mark Spritzler:
Spring AOP is a subset of AspectJ, only the Spring AOP part requires Spring. AspectJ does not. So why not use AspectJ instead.

Mark



Thanks Mark. I am new to AspectJ. Could you please point me to a simple logging example for beginners with AspectJ. I tried to read some tutorials from google but couldn't follow them and felt those are for advanced users.

Thanks,
Srikanth.
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the "AspectJ Language" section on the http://www.eclipse.org/aspectj/docs.php page. The Programming Guide includes a number of examples in the Getting Started and Examples section, amongst others.
 
Mark Spritzler
ranger
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Srikanth Reddy:


Thanks Mark. I am new to AspectJ. Could you please point me to a simple logging example for beginners with AspectJ. I tried to read some tutorials from google but couldn't follow them and felt those are for advanced users.

Thanks,
Srikanth.



Do you know Spring AOP? because it uses the same Expression Language as AspectJ

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!