I am usi开发者_开发技巧ng property file for customizing messages, mean while I am setting priority in the property file, can I test the equality of priority in JSP using <c:if>
tag. for message display in JSP I am using <fmt:message>
tag.
eg:
in property file:
priority.key=1
in jsp:
<c:if "<fmt:message "priority.key"\> ==1" >Hi</c:if>
The <fmt:message>
has a var
attribute which allows you to set the bundle value as a page scoped variable.
<fmt:message key="priority.key" var="priorityKey" />
This way it's available by ${priorityKey}
. You could then just use it as such in the <c:if>
.
<c:if test="${priorityKey == 1}">Hi</c:if>
May be this combination will help you:
http://www.roseindia.net/jstl/jstl-el.shtml and http://www.roseindia.net/jsp/simple-jsp-example/JSTLPropertyAccess.shtml
Personally for me it is very hard to understand your question. Please add more description or code.
精彩评论