Reply To: Rewrite in EARs with skinny wars

Splash Forums Rewrite Users Rewrite in EARs with skinny wars Reply To: Rewrite in EARs with skinny wars


Hmmm… I’m guessing that in order for this to work, you will need to manually add Rewrite to your web.xml in each WAR file. The default servlet filter registration for Rewrite is done in a web-fragment.xml, which is probably not picked up by WARs when you are referencing libraries from the EAR deployment classpath.

The Servlet 3.0 spec section 8.2.1 says: “Only jar files that are packaged in
WEB-INF/lib are scanned for META-INF/web-fragment.xml”

So you’ll need to add this to each web.xml:



      <filter-name>OCPsoft Rewrite Filter</filter-name>
      <filter-name>OCPsoft Rewrite Filter</filter-name>

Once that is done, you should be up and running. If you encounter any other strange behavior, it may be due to some ServiceLoader issues but we can work through those if they are a problem. EAR’s are weird 🙂