【问题标题】:Parameter in the message resource properties file of strutsstruts的消息资源属性文件中的参数
【发布时间】:2010-05-28 08:52:22
【问题描述】:

我正在使用 html:image 标记在 jsp 中包含图像。图像位置在 struts 的消息资源属性文件中指定。路径定义为 ../../images/image1.gid 以前。现在由于某种原因上下文正在发生变化,因此没有加载图像。如何访问消息资源文件中的上下文路径?我尝试了 key={0}/images/image1.gif,但这仅适用于 bean:message,因为它包含 arg0 属性。但我怎么做的形象?有什么办法吗?

PS:<img src=<bean:message arg0="<%=request.getContextPath()%>" key="image1"/>> 有效。但我无法更改 100 个使用 html:image 的 jsp 文件。

谢谢 V

【问题讨论】:

    标签: java jsp struts2 jsp-tags struts-html


    【解决方案1】:

    但我无法更改 100 多个使用 html:image 的 jsp 文件。

    使用带有在所有打开的文件中查找和替换功能的文本编辑器,例如EditplusNotepad++

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多