开发者

How to get the value of a directive's attribute from properties file based on Locale?

开发者 https://www.devze.com 2023-02-01 07:57 出处:网络
The task is to conditionally include a css file based on the Locale. To do this, I am going to put the path to the Locale dependent css file in the properties file. I am using the following directive

The task is to conditionally include a css file based on the Locale. To do this, I am going to put the path to the Locale dependent css file in the properties file. I am using the following directive to include the css in a page -

<%@ include file="/path/to/my.css" %>

How do I get the value of file attribute from properties file?

Note: I Have fmt taglib i开发者_StackOverflow中文版mplemented and working fine. So, I would like to do something like -

<%@ include file="<fmt:message key='page.css'/>" %>

But the above does not work for obvious reasons.


The @include is compiletime (get executed when JSP is to be compiled) while <fmt:message> is runtime (get executed when JSP is to be executed). You want to use the runtime include <jsp:include> instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消