tianjun309 发表于 2013-2-6 10:57:07

bean:message

*.jsp
<%@taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
  <bean:message key="name" bundle="testBundle"/>
  <bean:message key="name" bundle="testBundle2"/>
 
 
struts-config.xml
<message-resources parameter="com.test.ApplicationResources"  key="testBundle"/>
  <message-resources parameter="com.test.ApplicationResources2"  key="testBundle2"/>
 
ApplicationResources_en.properties
ApplicationResources_zh.properties
ApplicationResources2_en.properties
ApplicationResources2_zh.properties
 
<!-- 这里的bundle对应message-resources里面的key,然后再根据parameter里面的文件去找对应的<bean:message key>里面的key<message-resources parameter="com.test.ApplicationResources" key="test1" />    <message-resources parameter="com.test.ApplicationResources2" key="test2" /> --><bean:message key="test" bundle="test1"/> 
页: [1]
查看完整版本: bean:message