Class WebappServletPluginExtension

  • All Implemented Interfaces:
    PluginExtension
    Direct Known Subclasses:
    PluginConfigExtension

    @API(type=EXTENDABLE,
         src=PUBLIC)
    @Deprecated
    public abstract class WebappServletPluginExtension
    extends java.lang.Object
    implements PluginExtension
    Deprecated.
    This API is deprecated because it's based on javax package that's no more supported starting with Servlet 5.0 specification and because this extension type isn't protected against CSRF attacks. Use ServletPluginExtension instead.

    This abstract should be extended in order to create a webapp plugin servlet extension.

    To register the servlet you just have to declare an extension of type "WebappServlet" in the plugin's plugin.xml file.

    For example: <extension type="WebappServlet" class="com.domain.example.WebappServletPluginExtensionImpl"/>

    The webapp will register it automatically. The Servlet will map it to an URL which is computed from the path returned by the getPath() method.

    For example, if the webapp is available at http://example.com/xml-editor/ and the getPath() method returns mypath, this servlet handles requests for the urls starting with: http://example.com/xml-editor/plugins-dispatcher/mypath/.

    Since:
    17
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.servlet.ServletConfig config
      Deprecated.
      The servlet configuration.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void doDelete​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
      Deprecated.
      Servlet's doDelete method.
      void doGet​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
      Deprecated.
      Servlet's doGet method.
      void doPost​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
      Deprecated.
      Servlet's doPost method.
      void doPut​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
      Deprecated.
      Servlet's doPut method.
      abstract java.lang.String getPath()
      Deprecated.
      Should be implemented to return the relative path handled by this plugin.
      javax.servlet.ServletConfig getServletConfig()
      Deprecated.
       
      void init()
      Deprecated.
      Servlet's init() method.
      void init​(javax.servlet.ServletConfig config)
      Deprecated.
      Init function that stores the config.
      boolean requiresAuthorization()
      Deprecated.
       
      void service​(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
      Deprecated.
      Servlet's service method.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • config

        protected javax.servlet.ServletConfig config
        Deprecated.
        The servlet configuration.
    • Constructor Detail

      • WebappServletPluginExtension

        public WebappServletPluginExtension()
        Deprecated.
    • Method Detail

      • init

        public void init​(javax.servlet.ServletConfig config)
                  throws javax.servlet.ServletException
        Deprecated.
        Init function that stores the config. Consider overriding the init() method instead. If you decide to override this one, call the super implementation.
        Parameters:
        config - The configuration.
        Throws:
        javax.servlet.ServletException
      • init

        public void init()
                  throws javax.servlet.ServletException
        Deprecated.
        Servlet's init() method.
        Throws:
        javax.servlet.ServletException
      • service

        public void service​(javax.servlet.http.HttpServletRequest req,
                            javax.servlet.http.HttpServletResponse resp)
                     throws javax.servlet.ServletException,
                            java.io.IOException
        Deprecated.
        Servlet's service method.
        Parameters:
        req - the request.
        resp - the response.
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • doGet

        public void doGet​(javax.servlet.http.HttpServletRequest req,
                          javax.servlet.http.HttpServletResponse resp)
                   throws javax.servlet.ServletException,
                          java.io.IOException
        Deprecated.
        Servlet's doGet method.
        Parameters:
        req - the request.
        resp - the response.
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • doPost

        public void doPost​(javax.servlet.http.HttpServletRequest req,
                           javax.servlet.http.HttpServletResponse resp)
                    throws javax.servlet.ServletException,
                           java.io.IOException
        Deprecated.
        Servlet's doPost method.
        Parameters:
        req - the request.
        resp - the response.
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • doPut

        public void doPut​(javax.servlet.http.HttpServletRequest req,
                          javax.servlet.http.HttpServletResponse resp)
                   throws javax.servlet.ServletException,
                          java.io.IOException
        Deprecated.
        Servlet's doPut method.
        Parameters:
        req - the request.
        resp - the response.
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • doDelete

        public void doDelete​(javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse resp)
                      throws javax.servlet.ServletException,
                             java.io.IOException
        Deprecated.
        Servlet's doDelete method.
        Parameters:
        req - the request.
        resp - the response.
        Throws:
        javax.servlet.ServletException
        java.io.IOException
      • getPath

        public abstract java.lang.String getPath()
        Deprecated.
        Should be implemented to return the relative path handled by this plugin. The path should be unique among other webapp servlet plugins paths and should contain only lower case letters or the '-' sign. Example: "plugin-path"
        Returns:
        the path at which the servlet will be accessed.
      • getServletConfig

        public javax.servlet.ServletConfig getServletConfig()
        Deprecated.
        Returns:
        Returns the servlet configuration.
      • requiresAuthorization

        public boolean requiresAuthorization()
        Deprecated.
        Returns:
        True if this extension requires user to be authenticated as administrator.