Women in Technology

Hear us Roar



Article:
  Writing Servlet 2.3 Filters
Subject:   How do i get the name/url of the resource being requested in the doFilter method of the filter.
Date:   2002-10-28 03:29:28
From:   anonymous2
How do i get the name/url of the resource being requested in the doFilter method of the filter.
Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • How do i get the name/url of the resource being requested in the doFilter method of the filter.
    2003-06-04 01:22:36  anonymous2 [View]

    HttpServletRequest hreq = ( HttpServletRequest )request;
    String url = new String( hreq.getRequestURL() );

    // This however excludes all the parameters.
    // You can use this to get them:

    java.util.Enumeration params = hreq.getParameterNames();
    while ( params.hasMoreElements() ) {
    String param = ( String )params.nextElement();
    String value = hreq.getParameter( param )
    }

    // JTR