1 package org.javabb.interceptor; 2 3 import org.javabb.infra.Configuration; 4 5 import com.opensymphony.webwork.ServletActionContext; 6 import com.opensymphony.xwork.ActionInvocation; 7 import com.opensymphony.xwork.interceptor.AroundInterceptor; 8 9 24 25 29 public class ConfigInterceptor extends AroundInterceptor { 30 31 36 protected void before(ActionInvocation invocation) throws Exception { 37 Configuration.realPath = ServletActionContext.getServletContext().getRealPath("/"); 38 } 39 40 47 protected void after(ActionInvocation invocation, String result) throws Exception { 48 } 50 51 54 public String intercept(ActionInvocation invocation) throws Exception { 55 before(invocation); 56 return invocation.invoke(); 57 } 58 } 59 | Popular Tags |