Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>What is the difference between the contextConfigLocation and namespace?</strong> contextConfigLocation is used to specify the path of spring config files, that means they'll be initialized. namespace is used to specify the path and name of the DispatcherServlet of Spring MVC. default is <code>[Dispatcher_name]-servlet.xml</code>, here is an example:</p> <pre><code>&lt;servlet&gt; &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt; &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;namespace&lt;/param-name&gt; &lt;param-value&gt;config/spring-mvc&lt;/param-value&gt; &lt;/init-param&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; </code></pre> <p>Spring will search a file to be used as it's mvc config by the path of <code>/WEB-INF/config/spring-mvc.xml</code>. <br/> <strong>Is the contextConfigLocation meant only for specifying the folders where the context class can find a XML definition</strong></p> <pre><code>&lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/config/app-*.xml&lt;/param-value&gt; &lt;/context-param&gt; </code></pre> <p>The code above showed that when application starting Spring will load all the the files which name starts with 'app-' and ends with '.xml' in the WEB-INF/config directory.</p> <p><strong>Should it use /WEB-INF/application-context.xml? And should you specify paths?</strong> <br/> Through the example all above we can know that when configurating Spring we need to specify the full path and generic file name and when SpringMVC only we should specify the path(if it's located in a directory, not include the WEB-INF directory) and name(not include the extension). <br/> Hope to help you:)</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. This table or related slice is empty.
    1. 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