https://bz.apache.org/bugzilla/show_bug.cgi?id=62895
Bug ID: 62895
Summary: load-on-startup of the @WebServlet does not word
Product: Tomcat 9
Version: 9.0.x
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Catalina
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -----
when i define a load-on-startup Servlet without url-patterns
if I use the web deployment descriptor(web.xml), I can use the below
configuration:
<servlet>
<servlet-name>timerServlet</servlet-name>
<servlet-class>org.crazyit.TimerServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
the Servlet will be created and init method will be invoked, When i started the
web app.
it means, if i use deploy the loadup-on-startup Servlet with web.xml,
everything is ok.
but, if i use @WebServlet Annotation, loadOnStartup doesnot work.
i use the same Servlet, i don't use the xml configuration,i just use
@WebServlet(loadOnStartup=1)
init method of the servlet will not be invoked, When i started the web app.
unless i use
@WebServlet(loadOnStartup=1, urlPatterns={}),
but it does not make senseļ¼because i don't need any url-pattern for the servlet
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]