我想将字符串变量传递给 struts 标记。
alert('<bean:message key="${result}"/>');
此标签负责从 ApplicationResources.properties 中提取消息。结果包含此消息的密钥。系统尝试使用相同的结果字符串本身而不是其内容。这是我得到的错误。
“缺少密钥“${result}”的消息
我看到了这个问题,我有了一个想法,但问题仍然存在。 Struts 自定义标签中属性中的变量
我的应用程序基于struts。
我用这样的东西,但我觉得它又丑又臭
if(result == 'a.b.c' )
alert('<bean:message key="a.b.c"/>');
else if(result == 'a.b.c' )
alert('<bean:message key="a.b.d"/>');
else if(result == 'a.b.d' )
alert('<bean:message key="a.b.d"/>');