Replace part of string in Struts2 tag

Is it possible to replace the value of a property in Struts2? I want to resolve the 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!

+4
source share
1 answer
 <img src="<s:property value='%{mimetype.replace("/", ".")}'/> 

Yes, maybe ognl allows you to use string methods directly

+2
source

All Articles