Is it possible to set welcome-file tag from standard web.xml file by servlet 3.0 annotation ?
<welcome-file-list>
<welcome-file>PageName.html</welcome-file>
</welcome-file-list>
The welcome files mechanism allows you to specify a list of files that the web container will use for appending to a request for a URL (called a valid partial request) that is not mapped to a web component.
Use the @WebServlet annotation to define a servlet component in a web application. This annotation is specified on a class and contains metadata about the servlet being declared. The annotated servlet must specify at least one URL pattern. This is done by using the urlPatterns or value attribute on the annotation.
No, there is not such annotation at the moment. Servlet 3.0 annotations are InitParam, ServletFilter, WebServlet, WebServletContextListener, there's nothin for the welcome files in there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With