KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > javabb > interceptor > ConfigInterceptor


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 /*
10  * Copyright 2004 JavaFree.org
11  *
12  * Licensed under the Apache License, Version 2.0 (the "License");
13  * you may not use this file except in compliance with the License.
14  * You may obtain a copy of the License at
15  *
16  * http://www.apache.org/licenses/LICENSE-2.0
17  *
18  * Unless required by applicable law or agreed to in writing, software
19  * distributed under the License is distributed on an "AS IS" BASIS,
20  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21  * See the License for the specific language governing permissions and
22  * limitations under the License.
23  */

24
25 /**
26  * $Id: ConfigInterceptor.java,v 1.6.8.2 2006/04/17 17:47:09 daltoncamargo Exp $
27  * @author Dalton Camargo - <a HREF="mailto:dalton@ag2.com.br">dalton@ag2.com.br </a> <br>
28  */

29 public class ConfigInterceptor extends AroundInterceptor {
30
31     /**
32      * @param invocation
33      * @throws Exception
34      * @see com.opensymphony.xwork.interceptor.AroundInterceptor#before(com.opensymphony.xwork.ActionInvocation)
35      */

36     protected void before(ActionInvocation invocation) throws Exception JavaDoc {
37         Configuration.realPath = ServletActionContext.getServletContext().getRealPath("/");
38     }
39
40     /**
41      * @param invocation
42      * @param result
43      * @throws Exception
44      * @see com.opensymphony.xwork.interceptor.AroundInterceptor#after(com.opensymphony.xwork.ActionInvocation,
45      * java.lang.String)
46      */

47     protected void after(ActionInvocation invocation, String JavaDoc result) throws Exception JavaDoc {
48         //
49
}
50
51     /**
52      * @see com.opensymphony.xwork.interceptor.Interceptor#intercept(com.opensymphony.xwork.ActionInvocation)
53      */

54     public String JavaDoc intercept(ActionInvocation invocation) throws Exception JavaDoc {
55         before(invocation);
56         return invocation.invoke();
57     }
58 }
59
Popular Tags