Using Spring’s AOP with your Struts Application: To tackle cross-cutting you can use Spring interceptors To use Spring’s AOP in your Struts Applications you need to : 1. Create the interceptor. 2. Registor the interceptor. 3. Delclare interceptors. For example A sample logging interceptor package net.champ.example1.employee.interceptors; import org.springframework.aop.MethodBeforeAdvice; import java.lang.reflect.Method; public class LoggingInterceptor implements MethodBeforeAdvice { public void beforeMethod(Method method, Object[] objects, Object o) throws Throwable { System.out.println("logging before intersection"); } } This interceptor will execute the beforeMethod() before every intersection (We are using MethodBeforeAdvice). Here we are just printing a line but we can use it for anything we like. Next let us register the interceptor. Registering the interceptor in the Spring config file <?xml version="1.0" encoding="UTF-8...
A site who helps developer to find out there solutions. We try our best to provide you the best suite solutions for your problems.Also we are ready to accept your suggestions.Please be co-operate with us for sake of your and our growing.