groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Wagenleitner (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-5227) AbstractHttpServlet should extend GenericServlet directly instead of HttpServlet
Date Wed, 21 Jun 2017 22:24:00 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-5227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16058363#comment-16058363
] 

John Wagenleitner commented on GROOVY-5227:
-------------------------------------------

I agree that {{AbstractHttpServlet}} should continue to extend from {{HttpServlet}}.  The
class is public and looks to be designed to be extended, so changing it to {{GenericServlet}}
would break others code.

Whereas {{AbstractHttpServlet}} is designed to be extended, its implementing classes {{GroovyServlet}}
and {{TemplateServlet}} do not appear to be.  Because of this I like suggestion 2, adding
a documentation note.




> AbstractHttpServlet should extend GenericServlet directly instead of HttpServlet
> --------------------------------------------------------------------------------
>
>                 Key: GROOVY-5227
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5227
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Groovlet / GSP
>    Affects Versions: 1.7.5
>            Reporter: Benjamin Gandon
>            Priority: Trivial
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message