开发者

Replace part of a string in a Struts2 tag

开发者 https://www.devze.com 2023-03-23 12:24 出处:网络
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:

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 lik开发者_JAVA技巧e this?

Thanks!


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消