Hi I have finally found the solution. It was actually simple. I had to specify the rewrite rule as a rewrite pattern in the standalone.xml under the tag : <virtual-server>
mine was similar to this: I was looking for a ?wsdl
<rewrite name="rule-1" pattern="^/contextA/(.*resource)" substitution="/contextB/resource" flags="R"/>
for the R refer to http://docs.jboss.org/jbossweb/7.0.x/rewrite.html. Please also note that I didn't specify any code with R nor did I need the jboss-web.xml and rewrite.properties files.