Class AdminRestServlet

  • All Implemented Interfaces:
    jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, java.io.Serializable

    public class AdminRestServlet
    extends jakarta.servlet.http.HttpServlet
    Forwards all requests into jersey context.

    Marks request with custom attribute ADMIN_PROPERTY to indicate admin rest usage. It may be used later to recognize rest origin. For example, AdminResourceFilter use it to prevent access to admin resources (annotated with AdminResource) from user context.

    Since:
    04.08.2015
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ADMIN_PROPERTY
      Request attribute name set with 'true' value to distinguish admin rest from user context rest call.
      • Fields inherited from class jakarta.servlet.http.HttpServlet

        LEGACY_DO_HEAD
    • Constructor Summary

      Constructors 
      Constructor Description
      AdminRestServlet​(jakarta.servlet.Servlet restServlet)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void service​(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp)  
      • Methods inherited from class jakarta.servlet.http.HttpServlet

        doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, init, service
      • Methods inherited from class jakarta.servlet.GenericServlet

        destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
      • Methods inherited from class java.lang.Object

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

      • ADMIN_PROPERTY

        public static final java.lang.String ADMIN_PROPERTY
        Request attribute name set with 'true' value to distinguish admin rest from user context rest call.
    • Constructor Detail

      • AdminRestServlet

        public AdminRestServlet​(jakarta.servlet.Servlet restServlet)
        Parameters:
        restServlet - dropwizard rest servlet (environment.getJerseyServletContainer())
    • Method Detail

      • service

        protected void service​(jakarta.servlet.http.HttpServletRequest req,
                               jakarta.servlet.http.HttpServletResponse resp)
                        throws jakarta.servlet.ServletException,
                               java.io.IOException
        Overrides:
        service in class jakarta.servlet.http.HttpServlet
        Throws:
        jakarta.servlet.ServletException
        java.io.IOException