1.) don't hardcode any absolute path! You can always get the current directory where your application started. In your case you can get the directory where you deployed the war-file with
- servletContext.getRealPath("/").
If you use relative path only then referencing to one file inside another is no problem. For example I use an entry in web.xml to reference to an .xsl file I need for transformation:
- ServletContext servletContext = request.getSession().getServletContext();
-
String xslFile= servletContext.getInitParameter("xslFile"); // e.g. "/xslFiles/myFile.xsl"
-
String xslFilePath = servletContext.getRealPath(xslFile) ; // e.g. "C:/Tomcat/webapps/ROOT/myApp/WEB-INF/xslFiles/myFile.xsl
2.) don't use *.dll files. Just get the corresponding *.jar file. Dll-files are platform dependent and only run on Microsoft Windows. If you access functions in dll-files through native calls in java (or whatever you do with the dll-files, I am really wondering about that), you need to provide the corresponding files for EVERY platform. For example corresponding *.so files for Linux, Mac-OS, AIX, HP-UX, Solaris and others. For each of these platforms, you need to provide your own platform-dependent installer. (For example InstallShield on Windows that copies your dll-files into the win32-directory). That's a lot of work and possibly not a good idea, so avoid *.dlls and use *.jar files instead, which can be easily deployed, no matter what operating system you are using. (Just put them into lib-directory or add them to your classpath)