Damien Lauberton created GTNPORTAL-2791:
-------------------------------------------
Summary: PLF4 - web.xml for all webapps improvements
Key: GTNPORTAL-2791
URL:
https://issues.jboss.org/browse/GTNPORTAL-2791
Project: GateIn Portal
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Affects Versions: 3.5.0.Final
Reporter: Damien Lauberton
Linked to GateIn 3.5.0.Final...
* Problem describe here in details:
source:
http://stackoverflow.com/questions/9820379/what-to-do-with-annotations-af...
{quote}
The slow startup is caused because every single class file in every single JAR file in
/WEB-INF/lib is also scanned for Servlet 3.0 specific annotations. You apparently have a
lot of (large) JAR files in /WEB-INF/lib.
The metadata-complete="true" indicates that the JAR files in /WEB-INF/lib
doesn't need to be scanned for Servlet 3.0 specific annotations, but the webapp's
own classes will still be scanned.
Note that you listed there two JSF annotations and one Java SE annotation, not any Servlet
3.0 annotations. The Servlet 3.0 annotations are listed in the javax.servlet.annotation
package. JSF will only scan for annotations when the JAR file contains a JSF 2.0
compatible /META-INF/faces-config.xml file. It won't immediately scan every single
class in every JAR file. The Java SE @Override annotation is not a runtime annotation, but
a compiletime aid only.
{quote}
* Solution
** 1/ for all web.xml, we need to put the proper header for all web.xml files
** 2/ Put the attribute metadata-complete=true on <web-app>
*** source:
http://dominikdorn.com/2010/03/web-xml-web-fragment-xml-2-3-2-4-2-5-3-0/
**
*** web.xml v3.0:
{code}
<?xml version="1.0" encoding="UTF-8"?>
<web-app
version="3.0"
metadata-complete="true"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
</web-app>
{code}
*** web-fragment.xml:
{code}
<web-fragment
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-fragment_3_0.xsd" version="3.0">
</web-fragment>
{code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira