Ben,
The spec says:
"A string containing only the / character indicates the "default" servlet of the application. In this case the servlet path is the request URI minus the context path and the path info is null."
"Servlet Path: The path section that directly corresponds to the mapping which activated this request. This path starts with a / character except in the case where the request is matched with the /* pattern, in which case it is an empty string. "
"PathInfo: The part of the request path that is not part of the Context Path or the Servlet Path. It is either null if there is no extra path, or is a string with a leading / .
So looking at your results, Jetty is giving you results as if the mapping was /j_acegi_security_check
I can't think of a legal mapping that would result in the WebSphere result of servlet path=/.
If the mapping was /j_acei_securitycheck, then a sp of / is just wrong.
If the mapping was /* then servletpath must be the empty string and the path info must start with a /
If the mapping was / then the servletpath should be the whole request URI and the path info must be null
So websphere is just plain wrong on this one !
cheers
Ben Alex wrote:
Hi everyone
The Acegi Security System for Spring (http://acegisecurity.sourceforge.net) uses HttpServletRequest getters in a filter. I do all the development of the project using Jetty, but we've had a report of problems with WebSphere 5.1.1. I'm writing to the Jetty list in the hope of gaining some clarification as to the correct behaviour of different HttpServletRequest getters.
Here are our filter logging directives:
logger.debug("REQ url: " + httpRequest.getRequestURL()); logger.debug("REQ servlet path: " + httpRequest.getServletPath()); logger.debug("REQ context path: " + httpRequest.getContextPath()); logger.debug("REQ path info: " + httpRequest.getPathInfo()); logger.debug("REQ path translated " + httpRequest.getPathTranslated()); logger.debug("REQ request url: " + httpRequest.getRequestURL());
Using Jetty 4.2.17 it returns:
REQ url: http://localhost:8080/contacts/j_acegi_security_check REQ servlet path: /j_acegi_security_check REQ context path: /contacts REQ path info: null REQ path translated null REQ request url: http://localhost:8080/contacts/j_acegi_security_check
Using WebSphere 5.1.1 (on a different machine) it returns:
REQ url: http://localhost:9080/Permit/j_acegi_security_check REQ servlet path: / REQ context path: /Permit REQ path info: j_acegi_security_check REQ path translated
/home/mark/Repositories/permit/PermitWeb/WebContent/j_acegi_security_check REQ request url: http://localhost:9080/Permit/j_acegi_security_check
So, is getServletPath() and getPathInfo() correct for Jetty or WebSphere? We're trying to detect the getServletPath() output as per Jetty (ie /j_acegi_security_check) so we know our filter should do something.
Any advice appreciated.
Ben
------------------------------------------------------- This SF.Net email is sponsored by: GNOME Foundation Hackers Unite! GUADEC: The world's #1 Open Source Desktop Event. GNOME Users and Developers European Conference, 28-30th June in Norway http://2004/guadec.org _______________________________________________ Jetty-support mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jetty-support
------------------------------------------------------- This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and evaluate today! http://www.installshield.com/Dev2Dev/0504 _______________________________________________ Acegisecurity-developer mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer