Servlet Filter before Welcome Page


General J2EE: Servlet Filter before Welcome Page

  1. Servlet Filter before Welcome Page (3 messages)

    Hi All,
    Thanks for reading this post.

    I am working with WAS 5.0.2 which uses Servlet 2.3. For Servlet Filters Servlet 2.3 has a limitation for Filters to function only for direct user request.I have welcome page named index.jsp. I defined a filter for the URL /index.jsp. This filter will get executed only when there is a user request /mysite/index.jsp, but if there is a request for /mysite the container is directly invoking index.jsp without calling the filter. I can't modify my index.jsp because it has been generated by few java classes and the source code is not available.

    Is there any work around to invoke the filter when there is a request without specifying index.jsp meaning http://localhost/mysite.

    Thanks in Advance

  2. What happens if you define the filter for / as well as /index.jsp?
  3. Thanks for the replay
    '/*' would make my filter to intercept for each and every request, but I want interception to happen only for index.jsp which I will specify in welocome list

  4. Try "/", not "/*".