开发者

Replace part of a string in a Struts2 tag

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜