我有我的 web.xml 文件,我在其中定义了上下文参数,然后我想从我的 jsp 文件中的变量中获取值。所以我尝试${initParam.variablename}
了但输出为空。
xml文件_
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<context-param>
<description>The relative path to product images</description>
<param-name>productImagePath</param-name>
<param-value>img/products/</param-value>
</context-param>
html
categoryImagePath: ${initParam.categoryImagePath}
提前致谢