SóProvas


ID
2091601
Banca
FGV
Órgão
CONDER
Ano
2013
Provas
Disciplina
Programação
Assuntos

Com relação aos conceitos relacionados à classe GenericServlet do pacote javax.servlet, analise as afirmativas a seguir.

I. Define uma servlet independente de protocolo.

II. Estende HttpServlet e substitui o método doGet ().

III. Implementa o métodolog(), o qual é declaradona interfaceServletContext.

Assinale:

Alternativas
Comentários
  • javax.servlet

    Servlet is a server-side web technology. As the name implies, it serves a client request and receives a response from the server. You have to implement javax.Servlet (Interface) to handle a servlet work.

     

    javax.servlet.GenericServlet

    GenericServlet defines a generic, protocol-independent servlet. Afirmativa I.

    GenericServlet gives a blueprint and makes writing servlet easier.

    GenericServlet provides simple versions of the life-cycle methods init and destroy and of the methods in the ServletConfig interface.

    GenericServlet implements the log method, declared in the ServletContext interface. Afirmativa III.

    To write a generic servlet, it is sufficient to override the abstract service() method.

     

    javax.servlet.http.HttpServlet

    HttpServlet defines a HTTP protocol specific servlet.

    HttpServlet gives a blueprint for Http servlet and makes writing them easier.

    HttpServlet extends the GenericServlet and hence inherits the properties GenericServlet.

     

    https://stackoverflow.com/questions/11530152/what-is-the-difference-between-genericservlet-httpservlet-and-a-servlet

  • Na minha visão, o item III também está errado, pois tem um acento em métodolog().