Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5227

AbstractHttpServlet should extend GenericServlet directly instead of HttpServlet

Agile BoardAttach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • 1.7.5
    • None
    • Groovlet / GSP
    • None

    Description

      The groovy.servlet.AbstractHttpServlet class overrides the service(HttpServletRequest, HttpServletResponse) method.

      Thus all the circuitry implemented in the javax.servlet.http.HttpServlet superclass is bypassed altogether, except the trivial service(ServletRequest, ServletResponse) method which only provides a convenient call to service(HttpServletRequest, HttpServletResponse), narrowing the request and response types to HTTP-dedicated subclasses.

      None of the doGet, getLastModified, doHead, doPost, doPut, doDelete, doOption, doTrace, is ever called. Are they relevant to any AbstractHttpServlet subclasses? I doubt so. The programming model of GroovyServlet currently implies re-implementing in Groovlets the way these HTTP methods should be answered.

      Then it might be a possible optimization to have AbstractHttpServlet extend GenericServlet directly, re-implementing in AbstractHttpServlet the trivial service(ServletRequest, ServletResponse) method of HttpServlet. This could prevent the unnecessary loading of the HttpServlet class in memory.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            benje Benjamin Gandon

            Dates

              Created:
              Updated:

              Slack

                Issue deployment