Source Code Cross Referenced for ServletActionContext.java in  » J2EE » webwork-2.2.6 » com » opensymphony » webwork » 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 » J2EE » webwork 2.2.6 » com.opensymphony.webwork 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2002-2003 by OpenSymphony
003:         * All rights reserved.
004:         */
005:        package com.opensymphony.webwork;
006:
007:        import com.opensymphony.xwork.ActionContext;
008:        import com.opensymphony.xwork.util.OgnlValueStack;
009:
010:        import javax.servlet.ServletContext;
011:        import javax.servlet.http.HttpServletRequest;
012:        import javax.servlet.http.HttpServletResponse;
013:        import javax.servlet.jsp.PageContext;
014:        import java.util.Map;
015:
016:        /**
017:         * Web-specific context information for actions. This class subclasses <tt>ActionContext</tt> which
018:         * provides access to things like the action name, value stack, etc. This class adds access to
019:         * web objects like servlet parameters, request attributes and things like the HTTP session.
020:         *
021:         * @author <a href="mailto:nightfal@etherlands.net">Erik Beeson</a>
022:         * @author Bill Lynch (docs)
023:         */
024:        public class ServletActionContext extends ActionContext implements 
025:                WebWorkStatics {
026:            public static final String WEBWORK_VALUESTACK_KEY = "webwork.valueStack";
027:
028:            private ServletActionContext(Map context) {
029:                super (context);
030:            }
031:
032:            public static ActionContext getActionContext(HttpServletRequest req) {
033:                OgnlValueStack vs = getValueStack(req);
034:                if (vs != null) {
035:                    return new ActionContext(vs.getContext());
036:                } else {
037:                    return null;
038:                }
039:            }
040:
041:            public static OgnlValueStack getValueStack(HttpServletRequest req) {
042:                return (OgnlValueStack) req
043:                        .getAttribute(WEBWORK_VALUESTACK_KEY);
044:            }
045:
046:            /**
047:             * Returns the HTTP page context.
048:             *
049:             * @return the HTTP page context.
050:             */
051:            public static PageContext getPageContext() {
052:                return (PageContext) ActionContext.getContext().get(
053:                        PAGE_CONTEXT);
054:            }
055:
056:            /**
057:             * Sets the HTTP servlet request object.
058:             *
059:             * @param request the HTTP servlet request object.
060:             */
061:            public static void setRequest(HttpServletRequest request) {
062:                ActionContext.getContext().put(HTTP_REQUEST, request);
063:            }
064:
065:            /**
066:             * Gets the HTTP servlet request object.
067:             *
068:             * @return the HTTP servlet request object.
069:             */
070:            public static HttpServletRequest getRequest() {
071:                return (HttpServletRequest) ActionContext.getContext().get(
072:                        HTTP_REQUEST);
073:            }
074:
075:            /**
076:             * Sets the HTTP servlet response object.
077:             *
078:             * @param response the HTTP servlet response object.
079:             */
080:            public static void setResponse(HttpServletResponse response) {
081:                ActionContext.getContext().put(HTTP_RESPONSE, response);
082:            }
083:
084:            /**
085:             * Gets the HTTP servlet response object.
086:             *
087:             * @return the HTTP servlet response object.
088:             */
089:            public static HttpServletResponse getResponse() {
090:                return (HttpServletResponse) ActionContext.getContext().get(
091:                        HTTP_RESPONSE);
092:            }
093:
094:            /**
095:             * Gets the servlet context.
096:             *
097:             * @return the servlet context.
098:             */
099:            public static ServletContext getServletContext() {
100:                return (ServletContext) ActionContext.getContext().get(
101:                        SERVLET_CONTEXT);
102:            }
103:
104:            public static void setServletContext(ServletContext servletContext) {
105:                ActionContext.getContext().put(SERVLET_CONTEXT, servletContext);
106:            }
107:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.