servlet-spec
  1. servlet-spec
  2. SERVLET_SPEC-42

Clarify wether @WebServletAnnotation can complete a preliminary servlet registration

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      The <servlet> web.xml element was changed to remove the requirement to specify a <servlet-class>. This results in what is referred to as a "preliminary servlet registration". The specification/javadocs describe how the ServletContext.addServlet() methods can be used to complete the registration, but does not mention whether or not a WebServletAnnotation can be used to do so.

      Eg
      web.xml contains:
      <servlet>
      <servlet-name>Foo</servlet-name>
      </servlet>

      FooServlet.java contains:
      @WebServlet(urlPatterns =

      {"/","/test/*"}

      , name="Foo", initParams=

      {@WebInitParam(name="fromAnnotation", value="xyz")}

      )
      public class FooServlet extends HttpServlet

      Is the servlet registration for "Foo" updated with classname "FooServlet" after processing the annotation?

        Activity

        janbartel created issue -
        Rajiv Mordani made changes -
        Field Original Value New Value
        Assignee Rajiv Mordani [ mode ]
        Rajiv Mordani made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Rajiv Mordani
            Reporter:
            janbartel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: