No class from jars in /WEB-INF/lib/.4. If web.xml specifies metadata-complete=true, then no class is parsed for annotations.
About Question enthuware.jwpv6.2.589 :
Moderator: admin
-
- Posts: 38
- Joined: Wed Oct 31, 2012 2:53 am
- Contact:
About Question enthuware.jwpv6.2.589 :
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.589 :
As per Section 8.1, "If metadata-complete is set to "true", the deployment tool MUST ignore any servlet annotations present in the class files of the application and web fragments.".
It means not just in jars in /web-inf/lib but all class files of the application.
HTH,
Paul.
It means not just in jars in /web-inf/lib but all class files of the application.
HTH,
Paul.
Re: About Question enthuware.jwpv6.2.589 :
If the @WebFilter name is specified, and it's the same as the DD one, the exception will not be thrown and the container will initialize only one instance of the filter. Moreover, the values specified in the annotation will be added to the attributes defined in the DD.
Is it not true for @WebServlet ?
Is it not true for @WebServlet ?
-
- Posts: 11
- Joined: Tue Sep 10, 2013 3:20 pm
- Contact:
Re: About Question enthuware.jwpv6.2.589 :
ḨTH...
If the name for the servlet in the web.xml does not match the name specified via the @WebServlet annotation, the web.xml file does not override the @WebServlet mapping. Instead, it defines an additional mapping to the servlet to the URL mappings defined by the @WebServlet.
If the name of the servlet is the same in both the @WebServlet and the web.xml file, then the mapping in the web.xml overrides any URL mapping defined in the @WebServlet annotation.
Correct?
If the name for the servlet in the web.xml does not match the name specified via the @WebServlet annotation, the web.xml file does not override the @WebServlet mapping. Instead, it defines an additional mapping to the servlet to the URL mappings defined by the @WebServlet.
If the name of the servlet is the same in both the @WebServlet and the web.xml file, then the mapping in the web.xml overrides any URL mapping defined in the @WebServlet annotation.
Correct?
-
- Site Admin
- Posts: 10385
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.589 :
As per section 8.2.3 of Servlet 3.1 specification:
-Paul.iv. url-patterns, when specified in a descriptor for a given servlet name
overrides the url patterns specified via the annotation.
v. For a filter defined via the @WebFilter annotation, to override values via
the descriptor, the name of the filter in the descriptor MUST match the name
of the filter specified via the annotation (explicitly specified or the default
name, if one is not specified via the annotation).
Who is online
Users browsing this forum: No registered users and 5 guests