You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/02/11 06:18:19 UTC
DO NOT REPLY [Bug 6355] New: -
getPathInfo() returns null in forwarded servlet
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6355>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6355
getPathInfo() returns null in forwarded servlet
Summary: getPathInfo() returns null in forwarded servlet
Product: Tomcat 3
Version: 3.3 Final
Platform: Sun
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Servlet
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: Adnan.Music@ssmb.com.au
request.getPathInfo() returns null in a servlet that http request is forwarded
to.
To test this, save following servlet in examples web application
($TOMCAT_HOME/webapps/examples/WEB-INF/classes) and compile it.
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class ForwardServlet1 extends HttpServlet {
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
RequestDispatcher dispatcher = request.getRequestDispatcher
("/servlet/SnoopServlet");
dispatcher.forward(request, response);
}
}
Invoke the servlet:
http://yourHost:yourPort/examples/servlet/ForwardServlet1/fooPathInfo?a=b
Here is the output in my environment
============================================================================
Snoop Servlet
Servlet init parameters:
Context init parameters:
Context attributes:
org.apache.tomcat.classloader =
org.apache.tomcat.util.depend.DependClassLoader12@2352a5
Request attributes:
Servlet Name: SnoopServlet
Protocol: HTTP/1.0
Scheme: http
Server Name: access-prs.au.ssmb.com
Server Port: 9878
Server Info: Tomcat Web Server/3.3 Final ( JSP 1.1; Servlet 2.2 )
Remote Addr: 169.191.96.112
Remote Host: sydap1-2-qfe5.au.ssmb.com
Character Encoding: null
Content Length: 0
Content Type: null
Locale: en_US
Default Response Buffer: 8192
Parameter names in this request:
a = b
Headers in this request:
accept: */*
accept-encoding: gzip, deflate
accept-language: en-us
cache-control: max-age=604800
connection: keep-alive
cookie: JSESSIONID=9r6cjccz31; LoginUrl=http%3A%2F%2Faccess-prs.au.ssmb.com%
3A9878%2FResearch%2FDyn%2FDocServer%2Fcompanyresearch%2FLookup%2F%2FDyn%
2FDocServer%2Fcompanyresearch%2FLookup%2F%3Fsection%3D1;
SITESERVER=ID=46ce64a06ab3f8102ff0b7f5f6628d46
host: access-prs.au.ssmb.com:9878
pragma: no-cache
user-agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
via: 1.1 sydap1-2.au.ssmb.com:8080 (Squid/2.3.STABLE4-hno.20000819)
x-forwarded-for: 169.191.80.194
content-length: 0
Cookies in this request:
JSESSIONID = 9r6cjccz31
LoginUrl = http%3A%2F%2Faccess-prs.au.ssmb.com%3A9878%2FResearch%2FDyn%
2FDocServer%2Fcompanyresearch%2FLookup%2F%2FDyn%2FDocServer%2Fcompanyresearch%
2FLookup%2F%3Fsection%3D1
SITESERVER = ID=46ce64a06ab3f8102ff0b7f5f6628d46
Request Is Secure: false
Auth Type: null
HTTP Method: GET
Remote User: null
Request URI: /examples/servlet/SnoopServlet
Context Path: /examples
Servlet Path: /servlet/SnoopServlet
Path Info: null
Path Trans: null
Query String: a=b
Requested Session Id: null
Current Session Id: 218qqudp11
Session Created Time: 1013403818559
Session Last Accessed Time: 1013403818559
Session Max Inactive Interval Seconds: 1800
Session values:
=======================================================================
Path Info is null
If SnoopServlet is invoked directly:
http://yourHost:yourPort/examples/servlet/SnoopServlet/fooPathInfo?a=b
Path Info is reported correctly (/fooPathInfo)
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>