There is a bean set in xml, and has a method called getAllShareScopes which return a collection has a map of select element.
I found the getAllShareScopes method is simple, just return allShareScopes.
So where and when dose it get the value?
I found afterPropertiesSet methods, and knew the allShareScopes get value there.
And what's new to me is that, the afterPropertiesSet methods is invoked when the service is started, that is to say, when the server starts, the settings in xml files will be setted, and all the values may be stored in application!
The I18N work seems to be done when the server starts:
ctx.getMessage(scope.getLabelKey(), null, Locale.getDefault());
It's absolutely wrong, because we should get the client locale instead of the server's locale.
So the I18N work shouldn't be done here.
What we can do here is fetch the key value: String label = scope.getLabelKey();
Then do the i18n work in jsp file like:
<c:forEach var="scope" items="${allShareScopes}">
<option value="${scope.name}"><fmt:message key="${scope.label}"/></option>
</c:forEach>
This may be simple to others, but I learnt some from the research and fixing, so I record it.
分享到:
相关推荐
a18n |针对JavaScript / TypeScript / React的自动化I18n解决方案。该库使用AST操作将文本包装并提取到js / ts / jsx / tsx文件中,从而使添加I18n变得轻而易举。特征CLI(用于代码修改):用翻译电话a18n wrap ( ...
标题 "Admin generator, filters and I18n" 涉及到的是在Web开发中,特别是在使用Symfony框架时,如何创建后台管理界面(Admin generator),并实现过滤器(filters)和多语言支持(I18n)的功能。下面将详细阐述这...
1. `.gitattributes` - 这个文件用于配置Git在处理不同类型的文件时的行为,如文本编码或行结束符,确保代码在跨平台时的一致性。 2. `.gitignore` - 定义了Git应该忽略的文件或目录,防止将不必要的文件(如编译...
Intel Binary Modification Program(IBMP)是英特尔公司提供的一项技术,主要用于修改特定的固件或BIOS(基本输入输出系统)文件。这项技术的核心在于为开发者和系统制造商提供了对Intel处理器及平台固件的定制能力...
在本项目中,"modification1_布朗粒子扩散系数_源码"提供了计算粒子扩散系数的方法,具体通过平均平方位移(Mean Squared Displacement, MSD)这一统计学工具实现。 MSD是分析布朗运动的重要手段,它定义为一个粒子...
时间尺度修改(Time-Scale Modification, TSM)是指在不改变音频信号音调的前提下,对其播放速度进行加快或减慢的技术。在数字音乐制作领域,TSM已成为不可或缺的工具,并广泛集成到各种音乐制作软件中。由于音乐...
Genetic Modification of.pptx
Adenovirus small E1A causes changes in global histone modification patterns
《Repair and Modification of Printed Boards and Electronic Assemblies》是一本关于印刷电路板(PCB)维修与改装的专业指南,由Interconnecting and Packaging Electronic Circuits (IPC)组织开发。本书不仅涵盖了...
《考虑动态约束的自主机器人轨迹修改》 在自动驾驶领域,路径规划是至关重要的,它确保机器人或无人车辆能够安全、高效地从起点到达终点。传统的“弹性带”方法通过拉伸和压缩路径来避免障碍物,同时追求最短路径,...
Behavior modification. Bandura, Albert. Principles of behavior modification. New York: Holt, Rinehart & Winston, 1969, 677 p., [dollar] 9.95. Eysenck, H. J. (ed.) Experiments in behaviour therapy. New...
1. **gfx**:这部分通常包含游戏中的图形资源和图像处理代码。在作弊菜单中,gfx可能用于创建或修改游戏界面元素,如按钮、图标等,以便与作弊功能相匹配。它也可能涉及动画和特效的实现,让作弊提示更加直观和吸引...
a histogram modification work for better view on pics
### NEJM-T-CELL-Modification:Chimeric Antigen Receptor-Modified T Cells in Chronic Lymphoid Leukemia #### 概述 本研究通过基因转移技术设计了一种慢病毒载体,该载体能够表达一种针对B细胞抗原CD19的嵌合...
formatted-task035-winogrande-question-modification-person.json
formatted-task034-winogrande-question-modification-object.json
这个"z_bus_new.zip_Z-BUS_modification_z bus"压缩包显然涉及到对Z-BUS的修改或优化,可能是为了提高性能、增加功能或者适应新的硬件需求。 "z_bus_new.m"文件很可能是一个用MATLAB编写的脚本或函数,它可能包含了...
Surface Sterilization and Modification of Medical PTFE by Remote Argon Plasma,刘红霞,Jierong Chen,This paper studies remote argon plasma sterilization to medical Poly(tetrafluoroethylene)(PTFE) ...