当前位置: 代码迷 >> Java Web开发 >> 怎么让<html:text property="aa" />显示.properties资源文件的键值?
  详细解决方案

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

热度:727   发布时间:2016-04-17 15:11:47.0
如何让<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 ' /> " />
  相关解决方案