Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p><em>Why is Realm setting required in Server.xml and not web.xml</em></p> </blockquote> <p>This is not true, you can define it in your webapp as well, but then only in a servletcontainer-specific configuration file, such as <code>/META-INF/context.xml</code> in case of Tomcat. It cannot be definied in <code>/WEB-INF/web.xml</code> because it's specific to the standard Servlet API, not the servletcontainer implementation.</p> <hr> <blockquote> <p><em>But wouldn't that apply to all web application deployed on that server since it would become a server level configuration ?.</em></p> </blockquote> <p>That's correct. This is not recommended if you have no control over the server or if you don't want to publish the realm through other webapps.</p> <hr> <blockquote> <p><em>On a site I even saw a developer mentioning about context.xml but again can't see a standard document that mention about using this XML file for setting JDBC realm</em></p> </blockquote> <p>You can specify it in webapp's <code>/META-INF/context.xml</code>. See also <a href="http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context" rel="nofollow">Tomcat's own documentation on the <code>&lt;Context&gt;</code> element</a>:</p> <blockquote> <h2>Defining a context</h2> <p><strong>It is NOT recommended to place <code>&lt;Context&gt;</code> elements directly in the <code>server.xml</code> file.</strong> This is because it makes modifying the <strong>Context</strong> configuration more invasive since the main <code>conf/server.xml</code> file cannot be reloaded without restarting Tomcat.</p> <p>Individual Context elements may be explicitly defined:</p> <ul> <li><p>In an individual file at <code>/META-INF/context.xml</code> inside the application files. Optionally (based on the Host's copyXML attribute) this may be copied to <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code> and renamed to application's base file name plus a ".xml" extension.</p></li> <li><p>In individual files (with a ".xml" extension) in the <code>$CATALINA_BASE/conf/[enginename]/[hostname]/</code> directory. The context path and version will be derived from the base name of the file (the file name less the .xml extension). This file will always take precedence over any context.xml file packaged in the web application's META-INF directory.</p></li> <li><p>Inside a <a href="http://tomcat.apache.org/tomcat-7.0-doc/config/host.html" rel="nofollow">Host</a> element in the main <code>conf/server.xml</code>.</p></li> </ul> </blockquote> <p><em>(emphasis is not mine, it is already as such in Tomcat's documentation)</em></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.
 

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