There is to some extent the question of what is the servlet path supposed to be to a filter, since the filter executes outside the context of one particular servlet or another. So I think this is where the problem stems from. At the time the filter is invoked, the actual servlet which will handle the request is not necessarilly known (at least that's how I read it). As such, a filter should not rely on the getServletPath method. It should rely on the request url, the context path, but that's it...


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
_______________________________________________
Acegisecurity-developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer





------------------------------------------------------- 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 _______________________________________________ Acegisecurity-developer mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer

Reply via email to