Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 11608 invoked from network); 6 Dec 2001 20:25:20 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 6 Dec 2001 20:25:20 -0000 Received: (qmail 21982 invoked by uid 97); 6 Dec 2001 20:25:08 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@jakarta.apache.org Received: (qmail 21964 invoked by uid 97); 6 Dec 2001 20:25:07 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 21949 invoked from network); 6 Dec 2001 20:25:06 -0000 Message-ID: From: Anand Bashyam Narasimham To: "Tomcat Dev Mailing List (E-mail)" Subject: RE: getPathInfo problem Date: Thu, 6 Dec 2001 12:23:36 -0800 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Craig, I see the whole picture now. As regards to the question I did look into the Specs and for JSPs this must return "null" and for URL mapped Servlet it must return the path that the servlet is called with. Thanks all for your help finding this out. Anand -----Original Message----- From: Craig R. McClanahan [mailto:craigmcc@apache.org] Sent: Wednesday, December 05, 2001 10:18 PM To: Anand Bashyam Narasimham Subject: RE: getPathInfo problem You still haven't said what you think the *right* answer is, or what *wrong* answer you think this page returns. PLEASE be complete. When I try this on your server, it returns the source code of the JSP page itself (which means your server is not set up to handle JSP pages correctly). On my server running Tomcat 4.0.1, this returns null for both getPathInfo() and getPathTranslated(). Note that this is the correct answer! Because JSP pages are mapped using a "*.jsp" mapping, there will never be a non-null value for getPathInfo(), since the extension match has to happen on the last element of the request URI only. If you want the context relative path of the page itself (if your context path is "/thriftytest", this would be "/anand/pathtest/test.jsp"), you should call request.getServletPath() instead. If you want the physical disk pathname of this file (assuming you are running out of a directory, not a WAR file), you should call: String path = getServletContext().getRealPath(request.getServletPath()); Craig On Wed, 5 Dec 2001, Anand Bashyam Narasimham wrote: > Date: Wed, 5 Dec 2001 14:13:39 -0800 > From: Anand Bashyam Narasimham > To: 'Craig R. McClanahan' > Subject: RE: getPathInfo problem > > Ok, > > Here's a URL that you can try:- > > http://www.learningcircle.net/thriftytest/anand/pathtest/test.jsp > > The code in this JSP is as follows:- > <-----------------------------------Code Starts > here---------------------------> > > > The Path Info is <%=request.getPathInfo()%>::Path Translated > ="<%=request.getPathTranslated()%>
> Request URI is --><%=request.getRequestURI()%> > > > <-----------------------------------Code Ends > here-----------------------------> > > I did see another reply that says that these calls will not return correct > values from a JSP. Is this true if yes then would the same calls work from a > Servlet. > > Thanks > > Anand > -----Original Message----- > From: Craig R. McClanahan [mailto:craigmcc@apache.org] > Sent: Wednesday, December 05, 2001 12:01 PM > To: Tomcat Developers List > Cc: Anand Bashyam Narasimham > Subject: Re: getPathInfo problem > > > > > On Wed, 5 Dec 2001, Anand Bashyam Narasimham wrote: > > > Date: Wed, 5 Dec 2001 11:32:08 -0800 > > From: Anand Bashyam Narasimham > > Reply-To: Tomcat Developers List > > To: "Tomcat Dev Mailing List (E-mail)" > > Subject: getPathInfo problem > > > > Hi, > > > > I know there's been a lot of discussion around this and the bug filed says > > it's a "WORKSFORME" but somehow if I just install TOmcat3.3 and run the > > Snoop JSP in the example I get a "null" on getPathInfo as well as > > getPathTranslated(). Is there something that needs to be set on the > servlet > > mapping etc. > > > > If some on can give a concrete answer as to why this is so much a problem > it > > would be of great help. I tried a JSP with calls to getPathInfo() and > > getPathTranslated() on WebLogic 5.1 and the getPathTranslated works fine > but > > returns null in Tomcat. > > > > Anand > > > > As I asked for (twice!) in the bug report dialog, can you please provide a > test case that shows exactly what you think is wrong? The original > statement in the bug report was not correct, and you have not provided the > detail of exactly what behavior you are seeing, and what you are > expecting. > > Without that, there's nothing anyone here can do. > > Craig McClanahan > -- To unsubscribe, e-mail: For additional commands, e-mail: