KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > pageflow > interceptor > action > InterceptorForward


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.pageflow.interceptor.action;
19
20 import org.apache.beehive.netui.pageflow.Forward;
21 import org.apache.beehive.netui.pageflow.PageFlowController;
22 import org.apache.beehive.netui.pageflow.interceptor.InterceptorException;
23
24 import javax.servlet.http.HttpServletRequest JavaDoc;
25 import javax.servlet.ServletContext JavaDoc;
26 import java.net.URI JavaDoc;
27 import java.net.URISyntaxException JavaDoc;
28
29 import org.apache.struts.action.ActionForward;
30
31
32 /**
33  * Forward returned from an {@link ActionInterceptor} to alter the destination URI of a page flow action.
34  */

35 public class InterceptorForward extends Forward
36 {
37     protected InterceptorForward( Forward originalForward )
38     {
39         super( originalForward );
40     }
41     
42     /**
43      * Initialize from an existing Struts ActionForward
44      */

45     InterceptorForward( ActionForward originalForward, ServletContext JavaDoc servletContext, PageFlowController pageFlow )
46     {
47         super( originalForward, servletContext );
48         
49         if ( ! getContextRelative() )
50         {
51             setPath( pageFlow.getModulePath() + getPath() );
52             setContextRelative( true );
53         }
54     }
55     
56     protected InterceptorForward( HttpServletRequest JavaDoc request )
57     {
58         super( request );
59     }
60     
61     /**
62      * Construct from a URI.
63      *
64      * @param uri the URI pointed to by this Forward.
65      */

66     public InterceptorForward( URI JavaDoc uri )
67     {
68         super( uri );
69     }
70     
71     /**
72      * Construct from a URI.
73      *
74      * @param uri the URI pointed to by this Forward.
75      * @param redirect if <code>true</code>, the controller will redirect to the given URI; otherwise, a server forward
76      * will be performed.
77      */

78     public InterceptorForward( URI JavaDoc uri, boolean redirect )
79     {
80         super( uri, redirect );
81     }
82     
83     /**
84      * @exclude
85      */

86     public void rehydrateRequest( HttpServletRequest JavaDoc request )
87     {
88     }
89 }
90
Popular Tags