Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-29502

API: Please provide a method to initialize the ServletContextThreadLocal from a trigger plug-in

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      NOTE: This suggestion is for Confluence Cloud. Using Confluence Server? See the corresponding suggestion.

      I am currently writing a plug-in which shares pages by parsing incoming e-mail (https://github.com/schakko/Confluence-Mail-to-News-Plugin). The plug-in is realized as a trigger so there is no HttpServletContext available.

      For the plug-in I use the SharePageImpl.sharePage() method but the call results in a NullPointerException: createWebResourceDataSource() access the ServletContextThreadLocal which is not available.
      To solve this issue I have to use the deprecated API method ServletContextThreadLocal.setRequest(new MockHttpServletRequest()) with a mocked/stubbed instance of HttpServletRequest (https://github.com/schakko/Confluence-Mail-to-News-Plugin/blob/master/src/main/java/com/midori/confluence/plugin/mail2news/MailToBlogPostPublisher.java#L109).

      Please provide a method which initializes the ServletContextThreadLocal if a non-servlet plug-in runs or remove the @deprecated tag from ServletContextThreadLocal.setRequest().

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              3511ea2f06a2 Christopher Klein
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: