View Javadoc

1   /*
2    * $Id: StrutsStatics.java 421742 2006-07-13 23:48:46Z mrdon $
3    *
4    * Copyright 2006 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.struts2;
19  
20  
21  /***
22   * Constants used by Struts. The constants can be used to get or set objects 
23   * out of the action context or other collections.
24   * 
25   * <p/>
26   * 
27   * Example:
28   * <ul><code>ActionContext.getContext().put(HTTP_REQUEST, request);</code></ul>
29   * <p/>
30   * or
31   * <p/>
32   * <ul><code>
33   * ActionContext context = ActionContext.getContext();<br>
34   * HttpServletRequest request = (HttpServletRequest)context.get(HTTP_REQUEST);</code></ul>
35   */
36  public interface StrutsStatics {
37  
38      /***
39       * Constant for the HTTP request object.
40       */
41      public static final String HTTP_REQUEST = "com.opensymphony.xwork2.dispatcher.HttpServletRequest";
42  
43      /***
44       * Constant for the HTTP response object.
45       */
46      public static final String HTTP_RESPONSE = "com.opensymphony.xwork2.dispatcher.HttpServletResponse";
47  
48      /***
49       * Constant for an HTTP {@link javax.servlet.RequestDispatcher request dispatcher}.
50       */
51      public static final String SERVLET_DISPATCHER = "com.opensymphony.xwork2.dispatcher.ServletDispatcher";
52  
53      /***
54       * Constant for the {@link javax.servlet.ServletContext servlet context} object.
55       */
56      public static final String SERVLET_CONTEXT = "com.opensymphony.xwork2.dispatcher.ServletContext";
57  
58      /***
59       * Constant for the JSP {@link javax.servlet.jsp.PageContext page context}.
60       */
61      public static final String PAGE_CONTEXT = "com.opensymphony.xwork2.dispatcher.PageContext";
62      
63      /*** Constant for the PortletContext object */
64      public static final String STRUTS_PORTLET_CONTEXT = "struts.portlet.context";
65  }