Today’s feeling about write an interceptor

     Every day out teacher will give us a topic to write something we like, but in the weekend the time is belongs to us, and in the past, I usually don’t write the English journal, in order to form a good habit in the future, I plan to write some journals in the weekend, just like the habit I running at night.
     Last weekend I’m learning the struts2, and there is an important definition called the Interceptor, and they will be executed before or after the Action’s execute method is executed. This is an AOP programming mind, just like OOP. And today I want to implement an function to implement record the site access record. This is not very difficult to implement using Java Filter, but I want to use the newly learned interceptor to implement this.
     It’s same very easy to implement that. I’m using Struts2 and Spring to implement that, and configure the interceptor in the struts2’s configuration file, but It has caused a lot of error, and some error is I never encounter. In the past I have used interceptor many times, but I often copy the other person’s code. And never programming it by myself, may be lack of deeply thinking.
    In the future I will combine the practice with the theory, and in the past I feel I lack of practicing. Just review the other person’s code and some open source project’s code. And I hope I can form a good habit to practice more.

你可能感兴趣的:(spring,AOP,oop,Access)