From: Kent J. <kjo...@tr...> - 2001-03-29 14:42:30
|
I am trying out PyServlet using Jetty 2, a web server that implements the 2.1 servlet spec, and I have a little problem. The value of request.getServletPath() is different in 2.1 and 2.2 in a way that breaks PyServlet. Under 2.1, when the servlet is matched by an extension match, getServletPath() returns null. Under 2.2, it returns the entire path through the matched extension. The Servlet 2.1 spec says, public String getServletPath(); [snip] If the servlet was invoked by some other mechanism than by a path match (such as an extension match), then this method returns null. whereas the 2.2 spec has the example Servlet Mapping Pattern: *.jsp Servlet: JSPServlet /catalog/help/feedback.jsp ContextPath: /catalog ServletPath: /help/feedback.jsp PathInfo: null To make PyServlet work with Jetty I changed line 108 to read spath = ((HttpServletRequest) req).getServletPath() + ((HttpServletRequest) req).getPathInfo(); i think this will work under both 2.1 and 2.2, though I have not tested it with 2.2. Thanks! PyServlet is cool! Kent |