Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>FreeMarker template paths are resolved by a <code>TemplateLoader</code> object, which you should specify in the <code>Configuration</code> object. The path that you specify as the template path is interpreted by the <code>TemplateLoader</code>, and is usually relative to some kind of base directory (even if it starts with <code>/</code>), that's also called the template root directory for this reason. In your example, you haven't specified any <code>TemplateLoader</code>, so you are using the default <code>TemplateLoader</code>, which is only there for backward-compatibility, and is nearly useless (and also dangerous). So, do something like this:</p> <pre><code>config.setDirectoryForTemplateLoading(new File( "C:/Users/Jay/workspace/WebService/templates")); </code></pre> <p>and then:</p> <pre><code>config.getTemplate("fibplain.xml"); </code></pre> <p>Note that the <code>/template</code> prefix is not there now, as the template path is relative to <code>C:/Users/Jay/workspace/WebService/templates</code>. (This also means that the template can't back out of it with <code>../</code>-s, which can be important for security.)</p> <p>Instead of loading from a real directory, you can also load templates from a <code>SerlvetContext</code>, from the "class path", etc. It all depends on what <code>TemplateLoader</code> you are choosing.</p> <p>See also: <a href="http://freemarker.org/docs/pgui_config_templateloading.html">http://freemarker.org/docs/pgui_config_templateloading.html</a></p> <p>Update: If you get <code>FileNotFoundException</code> instead of <code>TemplateNotFoundException</code>, it's time to upgrade FreeMarker to at least 2.3.22. It also gives better error messages, like if you do the typical mistake of using the default <code>TemplateLoader</code>, it tells you that right in the error message. Less wasted developer time.</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