首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

怎么让<html:text property="aa" />显示.properties资源文件的键值?

2012-01-30 
如何让html:text propertyaa /显示.properties资源文件的键值??html:textproperty aa valuebea

如何让<html:text property="aa" />显示.properties资源文件的键值??
<html:text   property= "aa "   value= ' <bean:message   key= "a.b.c "   /> '   />
这样嵌套根本不行,有什么方法可以达到这样的目的吗?

[解决办法]
props= new Properties();
try{
props.load(new FileInputStream( "ch2/conf/msf_zh_AS.properties "));
strTest=props.getProperty( "test ");
}catch(Exception e){
System.out.println( "error : "+e.getMessage());
}
request.setAttribute( "test ",strTest);
..........................
msf_zh_AS.properties
test=haha
..........................
.jsp

<html:text property= "aa " value= '${test} ' />


[解决办法]
<html:text property= "aa " value= " <bean:message key= 'a.b.c ' /> " />

热点排行