www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jon * <...@clearink.com>
Subject Re: mod_jserv/5610: Incorrect translation of URL information
Date Fri, 21 Jan 2000 23:10:02 GMT
The following reply was made to PR mod_jserv/5610; it has been noted by GNATS.

From: jon * <jon@clearink.com>
To: Dmitry Novikov <dnovikov@tiis.com>
Cc: <apbugs@apache.org>
Subject: Re: mod_jserv/5610: Incorrect translation of URL information
Date: Fri, 21 Jan 2000 15:07:42 -0800

 on 1/21/00 3:00 PM, Dmitry Novikov <dnovikov@tiis.com> wrote:
 
 > Unfortunatelly req.getServletPath() returns value of this environment
 > variable.
 > This is fragment from source of java.org.apache.jserv.JServConnection:
 > /**
 > * Gets the part of this request's URI that refers to the servlet
 > * being invoked. Analogous to the CGI variable SCRIPT_NAME.
 > * @return the servlet being invoked, as contained in this
 > * request's URI.
 > */
 > public String getServletPath() {
 > return (String) env_vars.get("SCRIPT_NAME");
 > }
 > dmitry
 
 This works fine for me:
 
 http://www.working-dogs.com/example/ScriptName
 
 import java.io.*;
 import javax.servlet.*;
 import javax.servlet.http.*;
 public class ScriptName  extends HttpServlet {
 
 public void doGet(HttpServletRequest req, HttpServletResponse resp)
 throws ServletException, IOException {
   resp.setContentType("text/html");
   PrintWriter out = resp.getWriter();
   out.println("<HTML><HEAD>");
   out.println("<TITLE>HTML directory");
   out.println("</TITLE></HEAD><BODY TEXT=\"#800000\" BGCOLOR=\"#FEFBEB\">");
   out.println("Script Name: \"" + req.getServletPath() + "\"");
   out.println("</BODY></HTML>");
   out.close();
 }
 }
 
 -- 
 Come to the first official Apache Software Foundation
 Conference!  <http://ApacheCon.Com/>
 
 

Mime
View raw message