Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are a few problems with the solution of creating a <code>META-INF/context.xml</code> that contains <code>&lt;Context path="/myapp" allowLinking="true"&gt;</code></p> <p>The biggest issue is that if a <code>conf/context.xml</code> exists, the <code>allowLinking</code> in the <code>&lt;Context&gt;</code> there takes <strong>precedence over</strong> a <code>&lt;Context&gt;</code> in a <code>META-INF/context.xml</code>. And if the in the <code>conf/context.xml</code> does not explicitly define <code>allowLinking</code>, that's the same as saying <code>allowLinking="false"</code>. (see <a href="https://stackoverflow.com/questions/322260/which-tomcat-5-context-file-takes-precedence#322535">my answer</a> to a context precedence question)</p> <p>To be sure that your app allows linking, you have to say <code>&lt;Context override="true" allowLinking="true" ...&gt;</code>.</p> <p>Another issue is that the <code>path="/myapp"</code> is ignored in a <code>META-INF/context.xml</code>. To prevent confusion, it's best to leave it out. The only time <code>path</code> in a <code>&lt;Context&gt;</code> has any effect is in the <code>server.xml</code>, and the <a href="http://tomcat.apache.org/tomcat-5.5-doc/config/context.html" rel="nofollow noreferrer">official Tomcat docs recommend against</a> putting <code>&lt;Context&gt;</code>s in a <code>server.xml</code>.</p> <p>Finally, instead of a <code>myapp/META-INF/context.xml</code> file, I recommend using a <code>conf/Catalina/localhost/myapp.xml</code> file. This technique means you can keep the contents of your <code>META-INF</code> clean, which is the guts of your webapp -- I don't like to risk mucking about in the guts of my webapp. :-)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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