Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-69269

When adding listeners, servlets or filters by servlet API, they are not registered

    Details

      Description

      When using:

      1. servletContext.addFilter("myCustomFilterName", new MyCustomFilter())
      2. servletContext.addServlet("myCustomServletName" new MyServlet())
      3. servletContext.addListener(new MyCustomListener(())

      those won't get registered in webapp as they should.

      Steps to reproduce

      1. Deploy attached WAR to Liferay (com.lps69269.sample-1.0-SNAPSHOT.war).
      2. Access http://localhost:8080/o/com.lps69269.sample-1.0-SNAPSHOT/foo
      3. In other browser tab, access http://localhost:8080/o/com.lps69269.sample-1.0-SNAPSHOT/bar.

      Expected behavior:
      http://localhost:8080/o/com.lps69269.sample-1.0-SNAPSHOT/foo should write a sucess for Filter and Listener instances added by API:

      Adding listener instance through API works!
      
      Adding filter instance through API works!
      

      http://localhost:8080/o/com.lps69269.sample-1.0-SNAPSHOT/bar should write a sucess for a Servlet instance added by API:

      Instanciated servlet added by API works!
      

      Actual behavior:
      http://localhost:8080/o/com.lps69269.sample-1.0-SNAPSHOT/foo writes a FAIL for Filter and/or Listener instances added by API

      http://localhost:8080/o/com.lps69269.sample-1.0-SNAPSHOT/bar does not exists.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                2 years, 20 weeks, 4 days ago