1 Reply Latest reply on Oct 11, 2010 4:40 AM by aslak

    More complete support for Servlet 2.5 containers

    dan.j.allen

      I think we've convinced ourselves that the task of supporting Servlet 2.5 containers fully with a proper protocol implementation is more difficult than it really is. By that, I mean we're being too conservative by not trying to merge into a web.xml file in an application WAR deployment. What we need to add is a single servlet definition and it's really not going to be a problem.

       

      I recognize that the descriptors project is going to aim to make this simpler, more elegant and more deterministic. But we are getting a lot of requests to use Arquillian on containers that use Servlet 2.5, people who are getting tripped up and discouraged. We don't want a small fix to get stuck behind a large enhancement. I'm a firm believe in incremental enhancement, especially when it's going to help people right away.

       

      The good news is that I got it working. I spend the end of last week and the weekend getting Weld Servlet to run on EAP 5.1, which includes an Arquillian test. I can vouch for the fact that the approach I took works and solves the problem.

       

      JIRA: ARQ-316

      Implementation: ARQ-316 prototype branch

       

      There are two difficult steps, and the rest is just archive creation:

       

      1. web.xml
        • If the application is, or has, a war file with a web.xml, merge the protocol web.xml into it using the standard Java XML libraries
        • If the application is, or has, a war file without a web.xml, use the protocol web.xml as the web.xml
      2. locating war in an ear
        • walk the ear and find the war (any will do for now, so assume the first) (ShrinkWrap APIs could be more helpful here)

       

      With our toe in the water, improvements will come.