struts的消息资源属性文件中的参数

发布于 2024-09-03 06:57:00 字数 383 浏览 4 评论 0原文

我使用 html:image 标签在 jsp 中包含图像。图片位置在struts的消息资源属性文件中指定。路径定义为 ../../images/image1.gid 之前。现在由于某种原因上下文正在改变,所以图像没有被加载。如何访问消息资源文件中的上下文路径?我尝试了 key={0}/images/image1.gif,但这仅适用于 bean:message,因为它包含 arg0 属性。但我该如何处理图像呢?有什么迂回的办法吗?

PS: >> 有效。但我无法更改数百个使用 html:image 的 jsp 文件。

谢谢 V

I am using the html:image tag to include images in the jsp. the image location is specified in the message resource properties file of struts. the paths are defined as
../../images/image1.gid previously. now the context is changing due to some reason, so the images are not being loaded. how do i access the context path in the message resource file? i tried key={0}/images/image1.gif, but this works only for the bean:message as it contains arg0 attribute. but how i do for the image? any round about way?

PS: <img src=<bean:message arg0="<%=request.getContextPath()%>" key="image1"/>> works. but i cant change in 100s of jsp files which uses html:image.

thanks
V

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

往日 2024-09-10 06:57:00

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

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

but i cant change in 100s of jsp files which uses html:image.

Use a text editor with Find & Replace in All Open Files facility, like Editplus and Notepad++.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文