Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] web-fragment.xml servlet/filter-mapping override in web.xml doesn't work in jetty-maven-plugin 9.2.1

It would be best if you file a bug at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Jetty&format=guided

--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts


On Tue, Jul 15, 2014 at 11:23 AM, Konstantin Gribov <grossws@xxxxxxxxx> wrote:
Hi, all.

I tried to use jetty 9 as lightweight container to make project for bug reproducion in IDE and found that jetty fails to deploy web application where servlet-mapping and/or filter-mapping for servlet/filter defined in web-fragment.xml are overriden in web.xml and servlet/filter aren't redefined in web.xml (so servlet/filter definition is only present in web-fragmanet.xml).

Servlet 3.0 spec defines normal behavior in section 8.2.3, g.vi-vii (https://jcp.org/aboutJava/communityprocess/mrel/jsr315/index.html). Also tomcat 7.0 and jboss as 7.1 works fine in such configuration.

I haven't found any information that servlet/filter should be defined both in web-fragment.xml and in web.xml if I want to override servlet/filter-mapping. It may be defined in both files as of servlet 3.0 and 3.1 specifications.

To reproduce:
- unzip archive
- cd idea-127332
- mvn clean install
- cd w2
- mvn jetty:run

Module w1 (without servlet/filter mappings override) deploys to jetty 9 successfully.

Both w1 and w2 can be deployed to tomcat7 (use mvn tomcat7:run) and jboss as 7 (mvn jboss-as:run)

Filters are prepending "filtered\n" to response, servlets return just "ok ,)\n".

Test mappings in w1 (from web-fragment.xml only):
- /w1/s1/* (servlet s1-3)
- /w1/s2/* (servlet s1-3, filter f2)
- /w1/s3/* (servlet s1-3, filter f3)
- /w1/s4 (servlet s4)

Test mappings in w2 (from web-fragment.xml with overrides for web.xml):
- /w2/s1/* (servlet s1-3)
- /w2/s2/* (servlet s1-3, filter f2)
- /w2/s3/* (servlet s1-3, filter f3 with overriden mapping)
- /w2/s4/* (servlet s4 with overriden mapping, filter f3 with overriden mapping)

All mapping in w2 works as expected in tomcat 7.0 and jboss as 7.1.

Environment:
linux, jdk7u60, maven 3.2.2, jetty-maven-plugin 9.2.1.v20140609

-- 
Best regards,
Konstantin Gribov.

_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top