View Javadoc
1   /*
2    * $Id$
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  package org.apache.struts.chain;
22  
23  import org.apache.struts.dispatcher.Dispatcher;
24  
25  
26  /**
27   * <p>Global constants for the Chain of Responsibility Library.</p>
28   */
29  public final class Constants {
30      // -------------------------------------------------- Context Attribute Keys
31  
32      /**
33       * <p>The default context attribute under which the Action for the current
34       * request will be stored.</p>
35       */
36      public static final String ACTION_KEY = "action";
37  
38      /**
39       * <p>The default context attribute under which the ActionConfig for the
40       * current request will be stored.</p>
41       */
42      public static final String ACTION_CONFIG_KEY = "actionConfig";
43  
44      /**
45       * <p>The default context attribute under which the ActionForm for the
46       * current request will be stored.</p>
47       */
48      public static final String ACTION_FORM_KEY = "actionForm";
49  
50      /**
51       * <p>The default context attribute under which the ActionServet for the
52       * current application will be stored.</p>
53       */
54      public static final String ACTION_SERVLET_KEY = "actionServlet";
55  
56      /**
57       * <p>The default context attribute under which a boolean flag indicating
58       * whether this request has been cancelled will be stored.</p>
59       */
60      public static final String CANCEL_KEY = "cancel";
61  
62      /**
63       * <p>The default context attribute under which an Exception will be
64       * stored before passing it to an exception handler chain.</p>
65       */
66      public static final String EXCEPTION_KEY = "exception";
67  
68      /**
69       * <p>The default context attribute under which the ForwardConfig for the
70       * current request will be stored.</p>
71       */
72      public static final String FORWARD_CONFIG_KEY = "forwardConfig";
73  
74      /**
75       * <p>The default context attribute under which the include path for the
76       * current request will be stored.</p>
77       */
78      public static final String INCLUDE_KEY = "include";
79  
80      /**
81       * <p>The default context attribute under which the Locale for the current
82       * request will be stored.</p>
83       */
84      public static final String LOCALE_KEY = "locale";
85  
86      /**
87       * <p>The default context attribute under which the MessageResources for
88       * the current request will be stored.</p>
89       */
90      public static final String MESSAGE_RESOURCES_KEY = "messageResources";
91  
92      /**
93       * <p>The default context attribute under which the ModuleConfig for the
94       * current request will be stored.</p>
95       */
96      public static final String MODULE_CONFIG_KEY = "moduleConfig";
97  
98      /**
99       * <p>The default context attribute key under which a Boolean is stored,
100      * indicating the valid state of the current request.  If not present, a
101      * value of Boolean.FALSE should be assumed.
102      */
103     public static final String VALID_KEY = "valid";
104 
105     // --------------------------------------------------------- Other Constants
106 
107     /**
108      * <p>The base part of the context attribute under which a Map containing
109      * the Action instances associated with this module are stored. This value
110      * must be suffixed with the module prefix in order to create a unique key
111      * per module.</p>
112      */
113     public static final String ACTIONS_KEY = "actions";
114 
115     /**
116      * <p>The base part of the context attribute under which a Map containing
117      * the Dispatcher instances associated with this module are stored. This value
118      * must be suffixed with the module prefix in order to create a unique key
119      * per module.</p>
120      *
121      * @see Dispatcher
122      * @since Struts 1.4
123      */
124     public static final String DISPATCHERS_KEY = "dispatchers";
125 
126     /**
127      * <p>The context attribute under which the Catalog containing our defined
128      * command chains has been stored.</p>
129      */
130     public static final String CATALOG_ATTR = "org.apache.struts.chain.CATALOG";
131 
132     /**
133      * <p>The request attribute under which the path information is stored for
134      * processing during a RequestDispatcher.include() call.</p>
135      */
136     public static final String INCLUDE_PATH_INFO =
137         "jakarta.servlet.include.path_info";
138 
139     /**
140      * <p>The request attribute under which the servlet path is stored for
141      * processing during a RequestDispatcher.include() call.</p>
142      */
143     public static final String INCLUDE_SERVLET_PATH =
144         "jakarta.servlet.include.servlet_path";
145 }