Source Code Cross Referenced for WebRequest.java in  » J2EE » wicket » wicket » protocol » http » 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 » wicket » wicket.protocol.http 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * $Id: WebRequest.java 4194 2006-02-08 10:39:03 -0800 (Wed, 08 Feb 2006)
003:         * jonathanlocke $ $Revision: 461858 $ $Date: 2006-02-08 10:39:03 -0800 (Wed, 08
004:         * Feb 2006) $
005:         * 
006:         * ==============================================================================
007:         * Licensed under the Apache License, Version 2.0 (the "License"); you may not
008:         * use this file except in compliance with the License. You may obtain a copy of
009:         * the License at
010:         * 
011:         * http://www.apache.org/licenses/LICENSE-2.0
012:         * 
013:         * Unless required by applicable law or agreed to in writing, software
014:         * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
015:         * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
016:         * License for the specific language governing permissions and limitations under
017:         * the License.
018:         */
019:        package wicket.protocol.http;
020:
021:        import java.util.Locale;
022:        import java.util.Map;
023:
024:        import javax.servlet.http.Cookie;
025:        import javax.servlet.http.HttpServletRequest;
026:
027:        import wicket.Request;
028:        import wicket.util.lang.Bytes;
029:
030:        /**
031:         * Subclass of Request for HTTP protocol requests which holds an underlying
032:         * HttpServletRequest object. A variety of convenience methods are available
033:         * that operate on the HttpServletRequest object. These methods do things such
034:         * as providing access to parameters, cookies, URLs and path information.
035:         * 
036:         * @author Jonathan Locke
037:         */
038:        public abstract class WebRequest extends Request {
039:            /**
040:             * Gets the application context path.
041:             * 
042:             * @return application context path
043:             */
044:            public abstract String getContextPath();
045:
046:            /**
047:             * Get the requests' cookies
048:             * 
049:             * @return Cookies
050:             */
051:            public Cookie[] getCookies() {
052:                return getHttpServletRequest().getCookies();
053:            }
054:
055:            /**
056:             * Gets the wrapped http servlet request object.
057:             * <p>
058:             * WARNING: it is usually a bad idea to depend on the http servlet request
059:             * directly. Please use the classes and methods that are exposed by Wicket
060:             * (such as {@link wicket.Session} instead. Send an email to the mailing
061:             * list in case it is not clear how to do things or you think you miss
062:             * functionality which causes you to depend on this directly.
063:             * </p>
064:             * 
065:             * @return the wrapped http serlvet request object.
066:             */
067:            public abstract HttpServletRequest getHttpServletRequest();
068:
069:            /**
070:             * Returns the preferred <code>Locale</code> that the client will accept
071:             * content in, based on the Accept-Language header. If the client request
072:             * doesn't provide an Accept-Language header, this method returns the
073:             * default locale for the server.
074:             * 
075:             * @return the preferred <code>Locale</code> for the client
076:             */
077:            public abstract Locale getLocale();
078:
079:            /**
080:             * Gets the request parameter with the given key.
081:             * 
082:             * @param key
083:             *            Parameter name
084:             * @return Parameter value
085:             */
086:            public abstract String getParameter(final String key);
087:
088:            /**
089:             * Gets the request parameters.
090:             * 
091:             * @return Map of parameters
092:             */
093:            public abstract Map getParameterMap();
094:
095:            /**
096:             * Gets the request parameters with the given key.
097:             * 
098:             * @param key
099:             *            Parameter name
100:             * @return Parameter values
101:             */
102:            public abstract String[] getParameters(final String key);
103:
104:            /**
105:             * Gets the servlet path.
106:             * 
107:             * @return Servlet path
108:             */
109:            public abstract String getServletPath();
110:
111:            /**
112:             * Retrieves the URL of this request for local use.
113:             * 
114:             * @return The request URL for local use, which is the context path + the
115:             *         relative url
116:             */
117:            public String getURL() {
118:                /*
119:                 * Servlet 2.3 specification : Context Path: The path prefix associated
120:                 * with the ServletContext that this servlet is a part of. If this
121:                 * context is the default context rooted at the base of the web server's
122:                 * URL namespace, this path will be an empty string. Otherwise, this
123:                 * path starts with a "/" character but does not end with a "/"
124:                 * character.
125:                 */
126:                return getContextPath() + '/' + getRelativeURL();
127:            }
128:
129:            /**
130:             * Create a runtime context type specific (e.g. Servlet or Portlet)
131:             * MultipartWebRequest wrapper for handling multipart content uploads.
132:             * 
133:             * @param maxSize
134:             *            the maximum size this request may be
135:             * @return new WebRequest wrapper implementing MultipartWebRequest
136:             */
137:            public abstract WebRequest newMultipartWebRequest(Bytes maxSize);
138:
139:            /**
140:             * Is the request an ajax request?
141:             *
142:             * @return True if the ajax is an ajax request. False if it's not.
143:             */
144:            public abstract boolean isAjax();
145:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.