读书人

怎么让lt;html:text property=quot;aaquot; /gt;显

发布时间: 2012-01-30 21:15:58 作者: rapoo

如何让<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 ' /> " />

读书人网 >Java Web开发

热点推荐