我正在使用Java开发应用程序,并且对Java EE平台不太熟悉。我在资源文件夹中有一个名为"51Degrees-EnterpriseV3_2.dat"的数据集文件。我该如何在web.xml文件中指定该文件的路径,以及如何在代码中检索该文件?
我正在使用Java开发应用程序,并且对Java EE平台不太熟悉。我在资源文件夹中有一个名为"51Degrees-EnterpriseV3_2.dat"的数据集文件。我该如何在web.xml文件中指定该文件的路径,以及如何在代码中检索该文件?
<context-param>
<param-name>you can mention here localtion variable name</param-name>
<param-value>location here </param-value>
</context-param>
web.xml
的正确方法。对于51Degrees V3.2数据文件,应该是这样的:<context-param>
<description>The name of the device database.</description>
<param-name>BINARY_FILE_PATH</param-name>
<param-value>51Degrees-EnterpriseV3_2.dat</param-value>
</context-param>
src/main/webapp/WEB-INF/51Degrees-EnterpriseV3_2.dat
src/main/resources
吗?你只是想在代码中访问该文件还是有其他原因需要在web.xml
中指定它? - Michael Edgar