Source Code Cross Referenced for WebActionContext.java in  » Web-Framework » struts-1.3.8 » org » apache » struts » chain » contexts » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » struts 1.3.8 » org.apache.struts.chain.contexts 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: WebActionContext.java 471754 2006-11-06 14:55:09Z husted $
003:         *
004:         * Licensed to the Apache Software Foundation (ASF) under one
005:         * or more contributor license agreements.  See the NOTICE file
006:         * distributed with this work for additional information
007:         * regarding copyright ownership.  The ASF licenses this file
008:         * to you under the Apache License, Version 2.0 (the
009:         * "License"); you may not use this file except in compliance
010:         * with the License.  You may obtain a copy of the License at
011:         *
012:         *  http://www.apache.org/licenses/LICENSE-2.0
013:         *
014:         * Unless required by applicable law or agreed to in writing,
015:         * software distributed under the License is distributed on an
016:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017:         * KIND, either express or implied.  See the License for the
018:         * specific language governing permissions and limitations
019:         * under the License.
020:         */
021:        package org.apache.struts.chain.contexts;
022:
023:        import org.apache.commons.chain.web.WebContext;
024:        import org.apache.struts.Globals;
025:        import org.apache.struts.config.ModuleConfig;
026:
027:        import java.util.Map;
028:
029:        /**
030:         * <p> Provide a Subclass of ActionContextBase which is understood to be
031:         * wrapping an instance of <code>org.apache.commons.chain.web.WebContext</code>.
032:         * </p>
033:         */
034:        public class WebActionContext extends ActionContextBase {
035:            /**
036:             * Instantiate this composite by wrapping an instance of WebContext.
037:             *
038:             * @param context The WebContext to wrap
039:             */
040:            public WebActionContext(WebContext context) {
041:                super (context);
042:            }
043:
044:            /**
045:             * Provide the wrapped WebContext for this composite.
046:             *
047:             * @return The wrapped WebContext
048:             */
049:            protected WebContext webContext() {
050:                return (WebContext) this .getBaseContext();
051:            }
052:
053:            public void release() {
054:                super .release();
055:            }
056:
057:            // -------------------------------
058:            // WebContext property wrappers
059:            // -------------------------------
060:
061:            /**
062:             * <p> Return an immutable Map that maps header names to the first (or
063:             * only) header value (as a String). </p>
064:             *
065:             * @return A immutable Map of web request header names
066:             */
067:            public Map getHeader() {
068:                return webContext().getHeader();
069:            }
070:
071:            /**
072:             * <p> Return an immutable Map that maps header names to the set of all
073:             * values specified in the request (as a String array). Header names must
074:             * be matched in a case-insensitive manner. </p>
075:             *
076:             * @return An immutable Map of web request header values
077:             */
078:            public Map getHeaderValues() {
079:                return webContext().getHeaderValues();
080:            }
081:
082:            /**
083:             * <p> Return an immutable Map that maps context application
084:             * initialization parameters to their values. </p>
085:             *
086:             * @return An immutable Map of web context initialization parameters
087:             */
088:            public Map getInitParam() {
089:                return webContext().getInitParam();
090:            }
091:
092:            /**
093:             * <p> Return a map whose keys are <code>String</code> request parameter
094:             * names and whose values are <code>String</code> values. </p> <p> For
095:             * parameters which were submitted with more than one value, only one
096:             * value will be returned, as if one called
097:             * <code>ServletRequest.getParameter(String)</code>
098:             * </p>
099:             *
100:             * @return A map of web request parameters
101:             */
102:            public Map getParam() {
103:                return webContext().getParam();
104:            }
105:
106:            /**
107:             * <p> Return a map whose keys are <code>String</code> request parameter
108:             * names and whose values are <code>String[]</code> values. </p>
109:             *
110:             * @return A map of web request parameter values (as an array)
111:             */
112:            public Map getParamValues() {
113:                return webContext().getParamValues();
114:            }
115:
116:            public Map getApplicationScope() {
117:                return webContext().getApplicationScope();
118:            }
119:
120:            public Map getRequestScope() {
121:                return webContext().getRequestScope();
122:            }
123:
124:            public Map getParameterMap() {
125:                return getParamValues();
126:            }
127:
128:            public Map getSessionScope() {
129:                return webContext().getSessionScope();
130:            }
131:
132:            // ISSUE: AbstractSelectModule set the precedent of doing this at the
133:            // "web context" level instead of the ServletWebContext level.
134:            // Consider whether that's how we want to do it universally for other
135:            // manipulations of the RequestScope or not...
136:            public void setModuleConfig(ModuleConfig moduleConfig) {
137:                super .setModuleConfig(moduleConfig);
138:                this .getRequestScope().put(Globals.MODULE_KEY, moduleConfig);
139:            }
140:
141:            /**
142:             * @see org.apache.struts.chain.contexts.ActionContext#getModuleConfig()
143:             */
144:            public ModuleConfig getModuleConfig() {
145:                ModuleConfig mc = super .getModuleConfig();
146:
147:                if (mc == null) {
148:                    mc = (ModuleConfig) this .getRequestScope().get(
149:                            Globals.MODULE_KEY);
150:                }
151:
152:                return mc;
153:            }
154:
155:            // ISSUE:  AbstractSelectModule set the precedent of doing this at the
156:            // "web context" level instead of the ServletWebContext level.  Consider
157:            // whether that's how we want to do it universally for other manipulations
158:            // of the RequestScope or not...
159:            public void setCancelled(Boolean cancelled) {
160:                super .setCancelled(cancelled);
161:
162:                // historic semantics of "isCancelled" are to consider any non-null
163:                // value in the request under Globals.CANCEL_KEY as "yes, this was
164:                // cancelled."
165:                if ((cancelled != null) && cancelled.booleanValue()) {
166:                    this .getRequestScope().put(Globals.CANCEL_KEY, cancelled);
167:                } else {
168:                    this .getRequestScope().remove(Globals.CANCEL_KEY);
169:                }
170:            }
171:
172:            public Boolean getCancelled() {
173:                Boolean cancelled = super .getCancelled();
174:
175:                if (cancelled == null) {
176:                    cancelled = (Boolean) this.getRequestScope().get(
177:                            Globals.CANCEL_KEY);
178:                }
179:
180:                return cancelled;
181:            }
182:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.