Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-2712

NPE in TemplatePageFilter.applyDecorator()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.1.2
    • 2.1.3
    • Plugin - SiteMesh
    • None

    Description

      When the ActionContextCleanUp->FreeMarkerPageFilter->FilterDispatcher chain are being used and the cleanup filter is applied to /* and the page filter is applied to /* and the filter dispatcher is only applied to *.action, the following NPE occurs:

      java.lang.NullPointerException
      at org.apache.struts2.sitemesh.TemplatePageFilter.applyDecorator(TemplatePageFilter.java:104)
      at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:62)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
      at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:97)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1041)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:354)

      In looking at TemplatePageFilter, it seems to assume that a Dispatcher has been set for the thread. Since the FilterDispatcher is never hit, this is not the case. It seems the only way to make this work is to make sure all three of the filters is applied to the same path.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rwallace Richard Wallace
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: