KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > pageflow > GlobalApp


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;
19
20 import javax.servlet.http.HttpServletRequest JavaDoc;
21 import javax.servlet.http.HttpServletResponse JavaDoc;
22 import javax.servlet.ServletContext JavaDoc;
23
24 import org.apache.beehive.netui.pageflow.internal.InternalUtils;
25 import org.apache.beehive.netui.pageflow.internal.InternalConstants;
26 import org.apache.struts.action.ActionForm;
27 import org.apache.struts.action.ActionMapping;
28
29
30 /**
31  * Base class for user-defined global state and fallback controller logic. A specific instance of
32  * this class (based on the Global.app/Global.java source file in the "global" package) is created and stored in
33  * the user session before any {@link PageFlowController} is created, and unless it is explicitly
34  * removed from the session, it is not freed until the session is invalidated.
35  * <p>
36  * Actions that are not handled by the current {@link PageFlowController} "bubble" up to the
37  * current GlobalApp instance, which gets a chance to handle them in user-defined action methods.
38  * Uncaught exceptions also bubble through the GlobalApp instance, which has a chance to catch
39  * them.
40  * <p>
41  * Data in the current GlobalApp instance can be accessed by databinding tags using the <code>globalApp</code> scope.
42  *
43  * @deprecated Use a {@link SharedFlowController} instead.
44  * @see PageFlowController
45  */

46 public class GlobalApp
47         extends SharedFlowController
48 {
49     /**
50      * Get the URI for the webapp.
51      * @return "/".
52      */

53     public String JavaDoc getURI()
54     {
55         return "/";
56     }
57     
58     public String JavaDoc getDisplayName()
59     {
60         return GLOBALAPP_SOURCEFILE_NAME;
61     }
62     
63     /**
64      * @deprecated Only page flows ({@link PageFlowController}s) can be nested.
65      */

66     public boolean isNestable()
67     {
68         return false;
69     }
70
71     /**
72      * Store information about the most recent action invocation.
73      */

74     void savePreviousActionInfo( ActionForm form, HttpServletRequest JavaDoc request, ActionMapping mapping,
75                                  ServletContext JavaDoc servletContext )
76     {
77         // Do nothing here -- Global.app actions do not 'count' as actions in the current page flow, unlike shared
78
// flow actions. This is basically deprecated behavior.
79
}
80 }
81
Popular Tags