i have a java-servlet project which deploys via Maven to a .war-file. this runs in the tomcat servlet container. since i am using Wordnet (to be precise i use this API: http://extjwnl.sourceforge.net/) i have a so called file_properties.xml file which holds a value for the “dictionary_path”. this value should hold the path to the stored dictionaries. when i tested on my local machine the following value – of course – worked: “C:\Users\XY\Documents\NetBeansProjects\project-name\src\main\resources\dict\”
after deployment to a war-file and running in tomcat this path of course does not work anymore. how can i enter the value in the XML correctly? the target folder lies in the war-file in the “\WEB-INF\classes” folder.
the xml looks like this right now:
<param name="dictionary_path" value="C:\Users\username\Documents\NetBeansProjects\projectname\src\main\resources\dict\"/>
SOLUTION:
we now solved this with a workaround: we do not need the XML file anymore. instead we instantiate the dictionary by providing the path:
String dictPath = WordNetDictionary.class.getResource("/dict").toExternalForm();
//trim dictPath here depending on the OS
this.dictionary = Dictionary.getFileBackedInstance(dictPath);
SOLUTION:
we now solved this with a workaround: we do not need the XML file anymore. instead we instantiate the dictionary by providing the path: