RE: RequestDispatcher.forward() forgets requestUri
Hi, I strongly suggest (to anyone on the list not having done so) reading the Servlet Specification: SRV.8.3.1 Included Request Parameters Except for servlets obtained by using the getNamedDispatcher method, a servlet that has been invoked by another servlet using the include method of RequestDispatcher has access to the path by which it was invoked. The following request attributes must be set: javax.servlet.include.request_uri javax.servlet.include.context_path javax.servlet.include.servlet_path javax.servlet.include.path_info javax.servlet.include.query_string These attributes are accessible from the included servlet via the getAttribute method on the request object and their values must be equal to the request URI, context path, servlet path, path info, and query string of the included servlet, respectively. If the request is subsequently included, these attributes are replaced for that include. If the included servlet was obtained by using the getNamedDispatcher method, these attributes must not be set. SRV.8.4 The Forward Method The forward method of the RequestDispatcher interface may be called by the calling servlet only when no output has been committed to the client. If output data exists in the response buffer that has not been committed, the content must be cleared before the target servlet's service method is called. If the response has been committed, an IllegalStateException must be thrown. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Nitschke Michael [mailto:[EMAIL PROTECTED] >Sent: Tuesday, May 25, 2004 4:37 AM >To: [EMAIL PROTECTED] >Subject: RequestDispatcher.forward() forgets requestUri > >I use RequestDispatcher.forward(path) and the original requestUri get lost. > >If it is suppoused to do so, is there a way to get the original requestUri >after the forward? > > > > > >Mit freundlichen Grüßen > > > >Michael Nitschke > > > > >MBI Institut für Marketingberatung AG > > > > > > > >Hietzinger Hauptstraße 119-121 >A-1130 Wien >tel +43 (1) 8777474 9710 >fax +43 (1) 8777474 9712 >e-mail [EMAIL PROTECTED] >www.mbi.co.at > > > > > > > >Der Austausch von Nachrichten mit o.a. Absender via e-mail dient >ausschliesslich Informationszwecken. >Rechtsgeschaeftliche Erklaerungen duerfen ueber dieses Medium nicht >ausgetauscht werden. > > > > >Correspondence with a.m. sender via e-mail is only for information >purposes. >This medium is not to be used for the exchange of legally-binding >communications. > > This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RequestDispatcher.forward() forgets requestUri
But in the API is written that this Abbributes are reset between requests. (Interface ServletRequest.setAttribute()) And if I use the names you provided below the values get overwritten with the values from the requestDispatcher. Isn't it supposed that the RequestDispatcher forwards the Request as it was the initial request from the client? mfg Michael Nitschke -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 25, 2004 2:57 PM To: Tomcat Users List Subject: RE: RequestDispatcher.forward() forgets requestUri Hi, I strongly suggest (to anyone on the list not having done so) reading the Servlet Specification: SRV.8.3.1 Included Request Parameters Except for servlets obtained by using the getNamedDispatcher method, a servlet that has been invoked by another servlet using the include method of RequestDispatcher has access to the path by which it was invoked. The following request attributes must be set: javax.servlet.include.request_uri javax.servlet.include.context_path javax.servlet.include.servlet_path javax.servlet.include.path_info javax.servlet.include.query_string These attributes are accessible from the included servlet via the getAttribute method on the request object and their values must be equal to the request URI, context path, servlet path, path info, and query string of the included servlet, respectively. If the request is subsequently included, these attributes are replaced for that include. If the included servlet was obtained by using the getNamedDispatcher method, these attributes must not be set. SRV.8.4 The Forward Method The forward method of the RequestDispatcher interface may be called by the calling servlet only when no output has been committed to the client. If output data exists in the response buffer that has not been committed, the content must be cleared before the target servlet's service method is called. If the response has been committed, an IllegalStateException must be thrown. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Nitschke Michael [mailto:[EMAIL PROTECTED] >Sent: Tuesday, May 25, 2004 4:37 AM >To: [EMAIL PROTECTED] >Subject: RequestDispatcher.forward() forgets requestUri > >I use RequestDispatcher.forward(path) and the original requestUri get lost. > >If it is suppoused to do so, is there a way to get the original requestUri >after the forward? > > > > > >Mit freundlichen Grüßen > > > >Michael Nitschke > > > > >MBI Institut für Marketingberatung AG > > > > > > > >Hietzinger Hauptstraße 119-121 >A-1130 Wien >tel +43 (1) 8777474 9710 >fax +43 (1) 8777474 9712 >e-mail [EMAIL PROTECTED] >www.mbi.co.at > > > > > > > >Der Austausch von Nachrichten mit o.a. Absender via e-mail dient >ausschliesslich Informationszwecken. >Rechtsgeschaeftliche Erklaerungen duerfen ueber dieses Medium nicht >ausgetauscht werden. > > > > >Correspondence with a.m. sender via e-mail is only for information >purposes. >This medium is not to be used for the exchange of legally-binding >communications. > > This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RequestDispatcher.forward() forgets requestUri
Hi, >Isn't it supposed that the RequestDispatcher forwards the Request as it was >the initial request from the client? No: that's one key distinction between the RequestDispatcher and HttpServletResponse#sendRedirect. Yoav This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RequestDispatcher.forward() forgets requestUri
Im using the Invokerservlet. mfg Michael Nitschke -Original Message- From: Nitschke Michael Sent: Tuesday, May 25, 2004 3:54 PM To: Tomcat Users List Subject: RE: RequestDispatcher.forward() forgets requestUri But in the API is written that this Abbributes are reset between requests. (Interface ServletRequest.setAttribute()) And if I use the names you provided below the values get overwritten with the values from the requestDispatcher. Isn't it supposed that the RequestDispatcher forwards the Request as it was the initial request from the client? mfg Michael Nitschke -Original Message- From: Shapira, Yoav [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 25, 2004 2:57 PM To: Tomcat Users List Subject: RE: RequestDispatcher.forward() forgets requestUri Hi, I strongly suggest (to anyone on the list not having done so) reading the Servlet Specification: SRV.8.3.1 Included Request Parameters Except for servlets obtained by using the getNamedDispatcher method, a servlet that has been invoked by another servlet using the include method of RequestDispatcher has access to the path by which it was invoked. The following request attributes must be set: javax.servlet.include.request_uri javax.servlet.include.context_path javax.servlet.include.servlet_path javax.servlet.include.path_info javax.servlet.include.query_string These attributes are accessible from the included servlet via the getAttribute method on the request object and their values must be equal to the request URI, context path, servlet path, path info, and query string of the included servlet, respectively. If the request is subsequently included, these attributes are replaced for that include. If the included servlet was obtained by using the getNamedDispatcher method, these attributes must not be set. SRV.8.4 The Forward Method The forward method of the RequestDispatcher interface may be called by the calling servlet only when no output has been committed to the client. If output data exists in the response buffer that has not been committed, the content must be cleared before the target servlet's service method is called. If the response has been committed, an IllegalStateException must be thrown. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Nitschke Michael [mailto:[EMAIL PROTECTED] >Sent: Tuesday, May 25, 2004 4:37 AM >To: [EMAIL PROTECTED] >Subject: RequestDispatcher.forward() forgets requestUri > >I use RequestDispatcher.forward(path) and the original requestUri get lost. > >If it is suppoused to do so, is there a way to get the original requestUri >after the forward? > > > > > >Mit freundlichen Grüßen > > > >Michael Nitschke > > > > >MBI Institut für Marketingberatung AG > > > > > > > >Hietzinger Hauptstraße 119-121 >A-1130 Wien >tel +43 (1) 8777474 9710 >fax +43 (1) 8777474 9712 >e-mail [EMAIL PROTECTED] >www.mbi.co.at > > > > > > > >Der Austausch von Nachrichten mit o.a. Absender via e-mail dient >ausschliesslich Informationszwecken. >Rechtsgeschaeftliche Erklaerungen duerfen ueber dieses Medium nicht >ausgetauscht werden. > > > > >Correspondence with a.m. sender via e-mail is only for information >purposes. >This medium is not to be used for the exchange of legally-binding >communications. > > This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]