1 /*
2 * Scope: a generic MVC framework.
3 * Copyright (c) 2000-2002, The Scope team
4 * All rights reserved.
5 *
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 *
11 * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 *
14 * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 *
18 * Neither the name "Scope" nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 *
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 *
35 *
36 * $Id: DummyHTTPRequest.java,v 1.3 2002/09/05 15:41:48 ludovicc Exp $
37 */
38 package test.controller.servlet;
39
40
41 import java.io.BufferedReader;
42 import java.io.IOException;
43 import java.util.Enumeration;
44 import java.util.Hashtable;
45 import java.util.Locale;
46 import javax.servlet.RequestDispatcher;
47 import javax.servlet.ServletInputStream;
48 import javax.servlet.http.Cookie;
49 import javax.servlet.http.HttpServletRequest;
50 import javax.servlet.http.HttpSession;
51
52 /***
53 * <P>
54 *
55 * An HTTPRequest used in testing the servlet controller/view impl. </P>
56 *
57 * @author <A HREF="mailto:smeyfroi@users.sourceforge.net">Steve Meyfroidt</A>
58 * @created 05 September 2002
59 * @version $Revision: 1.3 $ $Date: 2002/09/05 15:41:48 $
60 */
61 class DummyHTTPRequest implements HttpServletRequest {
62
63 private Hashtable parameters;
64
65 /***
66 * Constructor for the DummyHTTPRequest object
67 *
68 * @param inParameters TODO: Describe the Parameter
69 */
70 DummyHTTPRequest(String[][] inParameters) {
71 parameters = new Hashtable();
72 for (int i = 0; i < inParameters.length; i++) {
73 parameters.put(inParameters[i][0], inParameters[i][1]);
74 }
75 }
76
77 /***
78 * Returns an array containing all of the <code>Cookie</code> objects the
79 * client sent with this request. This method returns <code>null</code> if
80 * no cookies were sent.
81 *
82 * @return an array of all the <code>Cookies</code> included with this
83 * request, or <code>null</code> if the request has no cookies
84 */
85 public Cookie[] getCookies() {
86 return null;
87 }
88
89 /***
90 * Returns the name of the authentication scheme used to protect the
91 * servlet, for example, "BASIC" or "SSL," or <code>null</code> if the
92 * servlet was not protected. <p>
93 *
94 * Same as the value of the CGI variable AUTH_TYPE.
95 *
96 * @return a <code>String</code> specifying the name of the authentication
97 * scheme, or <code>null</code> if the request was not authenticated
98 */
99 public String getAuthType() {
100 return null;
101 }
102
103 /***
104 * Returns any extra path information after the servlet name but before the
105 * query string, and translates it to a real path. Same as the value of the
106 * CGI variable PATH_TRANSLATED. <p>
107 *
108 * If the URL does not have any extra path information, this method returns
109 * <code>null</code>.
110 *
111 * @return a <code>String</code> specifying the real path, or <code>null</code>
112 * if the URL does not have any extra path information
113 */
114 public String getPathTranslated() {
115 return null;
116 }
117
118 /***
119 * Returns an enumeration of all the header names this request contains. If
120 * the request has no headers, this method returns an empty enumeration. <p>
121 *
122 * Some servlet containers do not allow do not allow servlets to access
123 * headers using this method, in which case this method returns <code>null</code>
124 *
125 * @return an enumeration of all the header names sent with this request; if
126 * the request has no headers, an empty enumeration; if the servlet
127 * container does not allow servlets to use this method, <code>null</code>
128 */
129 public Enumeration getHeaderNames() {
130 return null;
131 }
132
133 /***
134 * Returns the value of the specified request header as a <code>long</code>
135 * value that represents a <code>Date</code> object. Use this method with
136 * headers that contain dates, such as <code>If-Modified-Since</code>. <p>
137 *
138 * The date is returned as the number of milliseconds since January 1, 1970
139 * GMT. The header name is case insensitive. <p>
140 *
141 * If the request did not have a header of the specified name, this method
142 * returns -1. If the header can't be converted to a date, the method throws
143 * an <code>IllegalArgumentException</code>.
144 *
145 * @param name a <code>String</code> specifying the name of the header
146 * @return a <code>long</code> value representing the date specified in the
147 * header expressed as the number of milliseconds since January 1, 1970
148 * GMT, or -1 if the named header was not included with the reqest
149 */
150 public long getDateHeader(String name) {
151 return -1;
152 }
153
154 /***
155 * Returns the value of the specified request header as a <code>String</code>
156 * . If the request did not include a header of the specified name, this
157 * method returns <code>null</code>. The header name is case insensitive.
158 * You can use this method with any request header.
159 *
160 * @param name a <code>String</code> specifying the header name
161 * @return a <code>String</code> containing the value of the requested
162 * header, or <code>null</code> if the request does not have a header
163 * of that name
164 */
165 public String getHeader(String name) {
166 return null;
167 }
168
169 /***
170 * Returns all the values of the specified request header as an <code>Enumeration</code>
171 * of <code>String</code> objects. <p>
172 *
173 * Some headers, such as <code>Accept-Language</code> can be sent by clients
174 * as several headers each with a different value rather than sending the
175 * header as a comma separated list. <p>
176 *
177 * If the request did not include any headers of the specified name, this
178 * method returns an empty <code>Enumeration</code>. The header name is case
179 * insensitive. You can use this method with any request header.
180 *
181 * @param name a <code>String</code> specifying the header name
182 * @return a <code>Enumeration</code> containing the values of the requested
183 * header, or <code>null</code> if the request does not have any
184 * headers of that name
185 */
186 public Enumeration getHeaders(String name) {
187 return null;
188 }
189
190 /***
191 * Returns a boolean indicating whether the authenticated user is included
192 * in the specified logical "role". Roles and role membership can be defined
193 * using deployment descriptors. If the user has not been authenticated, the
194 * method returns <code>false</code>.
195 *
196 * @param role a <code>String</code> specifying the name of the role
197 * @return a <code>boolean</code> indicating whether the user making this
198 * request belongs to a given role; <code>false</code> if the user has
199 * not been authenticated
200 */
201 public boolean isUserInRole(String role) {
202 return false;
203 }
204
205 /***
206 * Returns the value of the specified request header as an <code>int</code>.
207 * If the request does not have a header of the specified name, this method
208 * returns -1. If the header cannot be converted to an integer, this method
209 * throws a <code>NumberFormatException</code>. <p>
210 *
211 * The header name is case insensitive.
212 *
213 * @param name a <code>String</code> specifying the name of a request header
214 * @return an integer expressing the value of the request header or -1 if
215 * the request doesn't have a header of this name
216 */
217 public int getIntHeader(String name) {
218 return -1;
219 }
220
221 /***
222 * Returns the name of the HTTP method with which this request was made, for
223 * example, GET, POST, or PUT. Same as the value of the CGI variable
224 * REQUEST_METHOD.
225 *
226 * @return a <code>String</code> specifying the name of the method with
227 * which this request was made
228 */
229 public String getMethod() {
230 return "POST";
231 }
232
233 /***
234 * Returns any extra path information associated with the URL the client
235 * sent when it made this request. The extra path information follows the
236 * servlet path but precedes the query string. This method returns <code>null</code>
237 * if there was no extra path information. <p>
238 *
239 * Same as the value of the CGI variable PATH_INFO.
240 *
241 * @return a <code>String</code> specifying extra path information that
242 * comes after the servlet path but before the query string in the
243 * request URL; or <code>null</code> if the URL does not have any extra
244 * path information
245 */
246 public String getPathInfo() {
247 return null;
248 }
249
250 /***
251 * Returns the part of this request's URL that calls the servlet. This
252 * includes either the servlet name or a path to the servlet, but does not
253 * include any extra path information or a query string. Same as the value
254 * of the CGI variable SCRIPT_NAME.
255 *
256 * @return a <code>String</code> containing the name or path of the servlet
257 * being called, as specified in the request URL
258 */
259 public String getServletPath() {
260 return null;
261 }
262
263 /***
264 * Returns the portion of the request URI that indicates the context of the
265 * request. The context path always comes first in a request URI. The path
266 * starts with a "/" character but does not end with a "/" character. For
267 * servlets in the default (root) context, this method returns "".
268 *
269 * @return a <code>String</code> specifying the portion of the request URI
270 * that indicates the context of the request
271 */
272 public String getContextPath() {
273 return null;
274 }
275
276 /***
277 * Returns the query string that is contained in the request URL after the
278 * path. This method returns <code>null</code> if the URL does not have a
279 * query string. Same as the value of the CGI variable QUERY_STRING.
280 *
281 * @return a <code>String</code> containing the query string or <code>null</code>
282 * if the URL contains no query string
283 */
284 public String getQueryString() {
285 return null;
286 }
287
288 /***
289 * Returns the login of the user making this request, if the user has been
290 * authenticated, or <code>null</code> if the user has not been
291 * authenticated. Whether the user name is sent with each subsequent request
292 * depends on the browser and type of authentication. Same as the value of
293 * the CGI variable REMOTE_USER.
294 *
295 * @return a <code>String</code> specifying the login of the user making
296 * this request, or <code>null</code if the user login is not known
297 */
298 public String getRemoteUser() {
299 return null;
300 }
301
302 /***
303 * Checks whether the requested session ID came in as a cookie.
304 *
305 * @return <code>true</code> if the session ID came in as a cookie;
306 * otherwise, <code>false</code>
307 * @see #getSession
308 */
309 public boolean isRequestedSessionIdFromCookie() {
310 return false;
311 }
312
313 /***
314 * Returns a <code>java.security.Principal</code> object containing the name
315 * of the current authenticated user. If the user has not been
316 * authenticated, the method returns <code>null</code>.
317 *
318 * @return a <code>java.security.Principal</code> containing the name of the
319 * user making this request; <code>null</code> if the user has not been
320 * authenticated
321 */
322 public java.security.Principal getUserPrincipal() {
323 return null;
324 }
325
326 /***
327 * Returns the session ID specified by the client. This may not be the same
328 * as the ID of the actual session in use. For example, if the request
329 * specified an old (expired) session ID and the server has started a new
330 * session, this method gets a new session with a new ID. If the request did
331 * not specify a session ID, this method returns <code>null</code>.
332 *
333 * @return a <code>String</code> specifying the session ID, or <code>null</code>
334 * if the request did not specify a session ID
335 * @see #isRequestedSessionIdValid
336 */
337 public String getRequestedSessionId() {
338 return null;
339 }
340
341 /***
342 * Returns the part of this request's URL from the protocol name up to the
343 * query string in the first line of the HTTP request. For example:
344 * <blockquote>
345 * <table>
346 *
347 * <tralign=left>
348 *
349 * <th>
350 * First line of HTTP request
351 * <th>
352 *
353 * <th>
354 * Returned Value
355 * <tr>
356 *
357 * <td>
358 * POST /some/path.html HTTP/1.1
359 * <td>
360 *
361 * <td>
362 * /some/path.html
363 * <tr>
364 *
365 * <td>
366 * GET http://foo.bar/a.html HTTP/1.0
367 * <td>
368 *
369 * <td>
370 * http://foo.bar/a.html
371 * <tr>
372 *
373 * <td>
374 * HEAD /xyz?a=b HTTP/1.1
375 * <td>
376 *
377 * <td>
378 * /xyz
379 * </table>
380 * </blockquote> <p>
381 *
382 * To reconstruct an URL with a scheme and
383 * host, use {@link
384 * HttpUtils#getRequestURL}.
385 *
386 * @return a <code>String</code> containing the part of the URL from the
387 * protocol name up to the query string
388 * @see HttpUtils#getRequestURL
389 */
390 public String getRequestURI() {
391 return null;
392 }
393
394 /***
395 * Returns the current <code>HttpSession</code> associated with this request
396 * or, if if there is no current session and <code>create</code> is true,
397 * returns a new session. <p>
398 *
399 * If <code>create</code> is <code>false</code> and the request has no valid
400 * <code>HttpSession</code>, this method returns <code>null</code>. <p>
401 *
402 * To make sure the session is properly maintained, you must call this
403 * method before the response is committed.
404 *
405 * @param create TODO: Describe the Parameter
406 * @return the <code>HttpSession</code> associated with this request or
407 * <code>null</code> if <code>create</code> is <code>false</code> and
408 * the request has no valid session
409 * @see #getSession()
410 */
411 public HttpSession getSession(boolean create) {
412 return null;
413 }
414
415 /***
416 * Returns the current session associated with this request, or if the
417 * request does not have a session, creates one.
418 *
419 * @return the <code>HttpSession</code> associated with this request
420 * @see #getSession(boolean)
421 */
422 public HttpSession getSession() {
423 return null;
424 }
425
426 /***
427 * Checks whether the requested session ID is still valid.
428 *
429 * @return <code>true</code> if this request has an id for a valid session
430 * in the current session context; <code>false</code> otherwise
431 * @see #getRequestedSessionId
432 * @see #getSession
433 * @see HttpSessionContext
434 */
435 public boolean isRequestedSessionIdValid() {
436 return false;
437 }
438
439 /***
440 * Checks whether the requested session ID came in as part of the request
441 * URL.
442 *
443 * @return <code>true</code> if the session ID came in as part of a URL;
444 * otherwise, <code>false</code>
445 * @see #getSession
446 */
447 public boolean isRequestedSessionIdFromURL() {
448 return false;
449 }
450
451 /***
452 * @return The requestedSessionIdFromUrl value
453 * @deprecated As of Version 2.1 of the Java Servlet API, use {@link
454 * #isRequestedSessionIdFromURL} instead.
455 */
456 public boolean isRequestedSessionIdFromUrl() {
457 return false;
458 }
459
460 /***
461 * Returns a {@link RequestDispatcher} object that acts as a wrapper for the
462 * resource located at the given path. A <code>RequestDispatcher</code>
463 * object can be used to forward a request to the resource or to include the
464 * resource in a response. The resource can be dynamic or static. <p>
465 *
466 * The pathname specified may be relative, although it cannot extend outside
467 * the current servlet context. If the path begins with a "/" it is
468 * interpreted as relative to the current context root. This method returns
469 * <code>null</code> if the servlet container cannot return a <code>RequestDispatcher</code>
470 * . <p>
471 *
472 * The difference between this method and {@link
473 * ServletContext#getRequestDispatcher} is that this method can take a
474 * relative path.
475 *
476 * @param path a <code>String</code> specifying the pathname to the resource
477 * @return a <code>RequestDispatcher</code> object that acts as a wrapper
478 * for the resource at the specified path
479 * @see RequestDispatcher
480 * @see ServletContext#getRequestDispatcher
481 */
482 public RequestDispatcher getRequestDispatcher(String path) {
483 return null;
484 }
485
486 /***
487 * @param path TODO: Describe the Parameter
488 * @return The realPath value
489 * @deprecated As of Version 2.1 of the Java Servlet API, use {@link
490 * ServletContext#getRealPath} instead.
491 */
492 public String getRealPath(String path) {
493 return null;
494 }
495
496 /***
497 * Returns the value of the named attribute as an <code>Object</code>, or
498 * <code>null</code> if no attribute of the given name exists. <p>
499 *
500 * Attributes can be set two ways. The servlet container may set attributes
501 * to make available custom information about a request. For example, for
502 * requests made using HTTPS, the attribute <code>javax.servlet.request.X509Certificate</code>
503 * can be used to retrieve information on the certificate of the client.
504 * Attributes can also be set programatically using {@link
505 * ServletRequest#setAttribute}. This allows information to be embedded into
506 * a request before a {@link RequestDispatcher} call. <p>
507 *
508 * Attribute names should follow the same conventions as package names. This
509 * specification reserves names matching <code>java.*</code>, <code>javax.*</code>
510 * , and <code>sun.*</code>.
511 *
512 * @param name a <code>String</code> specifying the name of the attribute
513 * @return an <code>Object</code> containing the value of the attribute, or
514 * <code>null</code> if the attribute does not exist
515 */
516 public Object getAttribute(String name) {
517 return null;
518 }
519
520 /***
521 * Retrieves the body of the request as binary data using a {@link
522 * ServletInputStream}. Either this method or {@link #getReader} may be
523 * called to read the body, not both.
524 *
525 * @return a {@link ServletInputStream} object containing the body of the
526 * request
527 * @exception IOException if an input or output exception occurred
528 */
529 public ServletInputStream getInputStream() throws IOException {
530 return null;
531 }
532
533 /***
534 * Returns an <code>Enumeration</code> containing the names of the
535 * attributes available to this request. This method returns an empty <code>Enumeration</code>
536 * if the request has no attributes available to it.
537 *
538 * @return an <code>Enumeration</code> of strings containing the names of
539 * the request's attributes
540 */
541 public Enumeration getAttributeNames() {
542 return null;
543 }
544
545 /***
546 * Returns the value of a request parameter as a <code>String</code>, or
547 * <code>null</code> if the parameter does not exist. Request parameters are
548 * extra information sent with the request. For HTTP servlets, parameters
549 * are contained in the query string or posted form data. <p>
550 *
551 * You should only use this method when you are sure the parameter has only
552 * one value. If the parameter might have more than one value, use {@link
553 * #getParameterValues}. <p>
554 *
555 * If you use this method with a multivalued parameter, the value returned
556 * is equal to the first value in the array returned by <code>getParameterValues</code>
557 * . <p>
558 *
559 * If the parameter data was sent in the request body, such as occurs with
560 * an HTTP POST request, then reading the body directly via {@link
561 * #getInputStream} or {@link #getReader} can interfere with the execution
562 * of this method.
563 *
564 * @param name a <code>String</code> specifying the name of the parameter
565 * @return a <code>String</code> representing the single value of the
566 * parameter
567 * @see #getParameterValues
568 */
569 public String getParameter(String name) {
570 return (String) parameters.get(name);
571 }
572
573 /***
574 * Returns the name of the character encoding used in the body of this
575 * request. This method returns <code>null</code> if the request does not
576 * specify a character encoding
577 *
578 * @return a <code>String</code> containing the name of the chararacter
579 * encoding, or <code>null</code> if the request does not specify a
580 * character encoding
581 */
582 public String getCharacterEncoding() {
583 return null;
584 }
585
586 /***
587 * Returns the length, in bytes, of the request body and made available by
588 * the input stream, or -1 if the length is not known. For HTTP servlets,
589 * same as the value of the CGI variable CONTENT_LENGTH.
590 *
591 * @return an integer containing the length of the request body or -1 if the
592 * length is not known
593 */
594 public int getContentLength() {
595 return -1;
596 }
597
598 /***
599 * Returns the MIME type of the body of the request, or <code>null</code> if
600 * the type is not known. For HTTP servlets, same as the value of the CGI
601 * variable CONTENT_TYPE.
602 *
603 * @return a <code>String</code> containing the name of the MIME type of the
604 * request, or -1 if the type is not known
605 */
606 public String getContentType() {
607 return null;
608 }
609
610 /***
611 * Returns the name and version of the protocol the request uses in the form
612 * <i>protocol/majorVersion.minorVersion</i> , for example, HTTP/1.1. For
613 * HTTP servlets, the value returned is the same as the value of the CGI
614 * variable <code>SERVER_PROTOCOL</code>.
615 *
616 * @return a <code>String</code> containing the protocol name and version
617 * number
618 */
619 public String getProtocol() {
620 return "HTTP/1.0";
621 }
622
623 /***
624 * Returns the name of the scheme used to make this request, for example,
625 * <code>http</code>, <code>https</code>, or <code>ftp</code>. Different
626 * schemes have different rules for constructing URLs, as noted in RFC 1738.
627 *
628 * @return a <code>String</code> containing the name of the scheme used to
629 * make this request
630 */
631 public String getScheme() {
632 return "http";
633 }
634
635 /***
636 * Returns an <code>Enumeration</code> of <code>String</code> objects
637 * containing the names of the parameters contained in this request. If the
638 * request has no parameters, the method returns an empty <code>Enumeration</code>
639 * .
640 *
641 * @return an <code>Enumeration</code> of <code>String</code> objects, each
642 * <code>String</code> containing the name of a request parameter; or
643 * an empty <code>Enumeration</code> if the request has no parameters
644 */
645 public Enumeration getParameterNames() {
646 return parameters.keys();
647 }
648
649 /***
650 * Returns an array of <code>String</code> objects containing all of the
651 * values the given request parameter has, or <code>null</code> if the
652 * parameter does not exist. <p>
653 *
654 * If the parameter has a single value, the array has a length of 1.
655 *
656 * @param name a <code>String</code> containing the name of the parameter
657 * whose value is requested
658 * @return an array of <code>String</code> objects containing the
659 * parameter's values
660 * @see #getParameter
661 */
662 public String[] getParameterValues(String name) {
663 return new String[]{(String) parameters.get(name)};
664 }
665
666 /***
667 * Retrieves the body of the request as character data using a <code>BufferedReader</code>
668 * . The reader translates the character data according to the character
669 * encoding used on the body. Either this method or {@link #getReader} may
670 * be called to read the body, not both.
671 *
672 * @return a <code>BufferedReader</code> containing the body of the request
673 * @exception IOException if an input or output exception occurred
674 * @see #getInputStream
675 */
676 public BufferedReader getReader() throws IOException {
677 return null;
678 }
679
680 /***
681 * Returns the Internet Protocol (IP) address of the client that sent the
682 * request. For HTTP servlets, same as the value of the CGI variable <code>REMOTE_ADDR</code>
683 * .
684 *
685 * @return a <code>String</code> containing the IP address of the client
686 * that sent the request
687 */
688 public String getRemoteAddr() {
689 return "127.0.0.1";
690 }
691
692 /***
693 * Returns the host name of the server that received the request. For HTTP
694 * servlets, same as the value of the CGI variable <code>SERVER_NAME</code>.
695 *
696 * @return a <code>String</code> containing the name of the server to which
697 * the request was sent
698 */
699 public String getServerName() {
700 return "localhost";
701 }
702
703 /***
704 * Returns the port number on which this request was received. For HTTP
705 * servlets, same as the value of the CGI variable <code>SERVER_PORT</code>.
706 *
707 * @return an integer specifying the port number
708 */
709 public int getServerPort() {
710 return 80;
711 }
712
713 /***
714 * Returns the preferred <code>Locale</code> that the client will accept
715 * content in, based on the Accept-Language header. If the client request
716 * doesn't provide an Accept-Language header, this method returns the
717 * default locale for the server.
718 *
719 * @return the preferred <code>Locale</code> for the client
720 */
721 public Locale getLocale() {
722 return Locale.getDefault();
723 }
724
725 /***
726 * Returns the fully qualified name of the client that sent the request, or
727 * the IP address of the client if the name cannot be determined. For HTTP
728 * servlets, same as the value of the CGI variable <code>REMOTE_HOST</code>.
729 *
730 * @return a <code>String</code> containing the fully qualified name of the
731 * client
732 */
733 public String getRemoteHost() {
734 return "localhost";
735 }
736
737 /***
738 * Returns an <code>Enumeration</code> of <code>Locale</code> objects
739 * indicating, in decreasing order starting with the preferred locale, the
740 * locales that are acceptable to the client based on the Accept-Language
741 * header. If the client request doesn't provide an Accept-Language header,
742 * this method returns an <code>Enumeration</code> containing one <code>Locale</code>
743 * , the default locale for the server.
744 *
745 * @return an <code>Enumeration</code> of preferred <code>Locale</code>
746 * objects for the client
747 */
748 public Enumeration getLocales() {
749 return null;
750 }
751
752 /***
753 * Returns a boolean indicating whether this request was made using a secure
754 * channel, such as HTTPS.
755 *
756 * @return a boolean indicating if the request was made using a secure
757 * channel
758 */
759 public boolean isSecure() {
760 return false;
761 }
762
763 /***
764 * Stores an attribute in this request. Attributes are reset between
765 * requests. This method is most often used in conjunction with {@link
766 * RequestDispatcher}. <p>
767 *
768 * Attribute names should follow the same conventions as package names.
769 * Names beginning with <code>java.*</code>, <code>javax.*</code>, and
770 * <code>com.sun.*</code>, are reserved for use by Sun Microsystems.
771 *
772 * @param name a <code>String</code> specifying the name of the attribute
773 * @param o the <code>Object</code> to be stored
774 */
775 public void setAttribute(String name, Object o) { }
776
777 /***
778 * Removes an attribute from this request. This method is not generally
779 * needed as attributes only persist as long as the request is being
780 * handled. <p>
781 *
782 * Attribute names should follow the same conventions as package names.
783 * Names beginning with <code>java.*</code>, <code>javax.*</code>, and
784 * <code>com.sun.*</code>, are reserved for use by Sun Microsystems.
785 *
786 * @param name a <code>String</code> specifying the name of the attribute to
787 * remove
788 */
789 public void removeAttribute(String name) { }
790 }
791
This page was automatically generated by Maven