栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

spring国际化中的动态名称

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

spring国际化中的动态名称

它应该以您想要的方式工作:

<fmt:message key="list.${myVar}"/>

因为标签lib定义使该键成为表达式:fmt.tdl:

<taglib xmlns="http://java.sun.com/xml/ns/j2ee"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"    version="2.0">  <description>JSTL 1.1 i18n-capable formatting library</description>  <display-name>JSTL fmt</display-name>  <tlib-version>1.1</tlib-version>  <short-name>fmt</short-name>  <uri>http://java.sun.com/jsp/jstl/fmt</uri>...<tag>    <description>        Maps key to localized message and performs parametric replacement    </description>    <name>message</name>    <tag-class>org.apache.taglibs.standard.tag.rt.fmt.MessageTag</tag-class>    <body-content>JSP</body-content>    <attribute>        <description>Message key to be looked up.        </description>        <name>key</name>        <required>false</required>        <rtexprvalue>true</rtexprvalue>    </attribute>...

辩称在可能的应用程序中起作用的是

<%@ taglib prefix='spring' uri='http://www.springframework.org/tags'%>...<spring:message pre="myPrefix.${transaction.state}"/>


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/470872.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号