【发布时间】:2023-03-20 23:01:01
【问题描述】:
我正在尝试使用 taglib 读取来自 JSTL 的“属性文件”,但我无法访问它
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
我已经在 web.xml 中正确地找到了 tld 文件,我确定这一点
<taglib>
<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
<taglib-location>/WEB-INF/lib/fmt.tld</taglib-location>
</taglib>
属性文件名为 msg。属性
<fmt:bundle basename="msg">
<fmt:message key="error.more" />
</fmt:bundle>
我不断得到
???error.more???
而不是属性文件中的消息
我认为问题在于找到属性文件, 或在基本名称中
<fmt:bundle basename="msg">
我应该在哪里找到属性文件,如何在代码中引用它??
谢谢大家
【问题讨论】:
标签: properties jstl taglib