It seems OK at first glance, but there's something that annoys me: the order in which <listener-class> and <description> elements are presented. Accordingly to section SRV.13.3 (the DD's xsd schema):
So, all elements inside <filter> are declared in the xsd as being part of a <xsd:sequence>. If I understand it correctly, the order matters and therefore the snipped in the mock exam is wrong. The correct way should be:
It used to be that order mattered for everything on the web.xml and you were tested on it. My understanding is that order doesn't matter anymore. At the very least, there won't be anything on the exam to test you on ordering.
I will follow your advice. The thing that confused me was that in XML syntax the <xsd:sequence> element is used to provide an XML representation of an ordered set of element types. This means that a web.xml that uses the <filter> declaration mentioned in my first post won't pass validation against the XML schema. However, section SRV.13.2 of the spec states:
The deployment descriptor must be valid against the schema. Web containers and tools that manipulate Web applications have a wide range of options for checking the validity of a WAR. This includes checking the validity of the deployment descriptor document held within. The containers and tools that are part of J2EE technology-compliant implementation are required to validate deployment descriptor against the XML schema for structural correctness. The validation is recommended, but not required for the web containers and tools that are not part of J2EE technology-compliant implementation.
The paragraph in bold seems to confirm what you are saying. Many thanks!