Replace part of a string in a Struts2 tag

2020-07-18 05:02发布

Is it possible to replace the value of a property in Struts2? I want to resolve a mimetype image, and it would be really useful to do something like:

<img src="<s:property value='%{mimetype.replace("/", ".")}'/>" ...

Can I do something on the fly like this?

Thanks!

1条回答
倾城 Initia
2楼-- · 2020-07-18 05:41
<img src="<s:property value='%{mimetype.replace("/", ".")}'/>

Yes it's possible ognl allows to use string mehthods directly

查看更多
登录 后发表回答