Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Because the generated fragment is not a valid XML file ( it's a fragment after all ), it is not possible to use XSLT directly. On the other hand you don't have to. Here is a simple trick that will give you exactly what you need.</p> <p>In your web.xml file insert XML comment <code>&lt;!-- @JSPS_MAP@ --&gt;</code> between <code>&lt;servlet&gt;</code> and <code>&lt;servlet-mapping&gt;</code> elements, e.g.</p> <pre><code> &lt;servlet&gt; &lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt; &lt;servlet-class&gt;my.servlets.MyServlet&lt;/servlet-class&gt; &lt;servlet&gt; &lt;!-- @JSPS_MAP@ --&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;MyServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/my-servlet&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>Then use a token filter to replace <code>@JSPS_MAP@</code> tag with generated content.</p> <pre><code>&lt;loadfile property="generated.web.xml.fragment" srcFile="${generated.fragment.file}" /&gt; &lt;copy file="${orig-web-content.dir}/WEB-INF/web.xml" toFile="${generated-web-content.dir}/WEB-INF/web.xml" &gt; &lt;filterset&gt; &lt;filter token="JSPS_MAP" value=" --&amp;gt; ${generated.web.xml.fragment} &amp;lt;!-- " /&gt; &lt;/filterset&gt; &lt;/copy&gt; </code></pre> <p>This approach has an advantage that the original web.xml file is completely valid (a tag is hidden in the comment), but gives you total control of where and when the generated fragment will be inserted.</p> <p>So for DEV build, just copy <code>${orig-web-content.dir}/WEB-INF/web.xml</code> to <code>${generated-web-content.dir}/WEB-INF/web.xml</code> without filtering.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload