I'm attempting to use a lowercase Greek mu (μ) in my Struts2 text field's label, as such:

<s:textfield name="measurement" label="Time Measurement (&mu;s)" />

However, I'm seeing "Time Measurement (&mu;s)" instead of "Time Measurement (μs)". Struts2 seems to be helping me out by escaping my escaped label! I'd rather not resort to a) using the UTF-8 character which file systems, servers or browsers may not respect, or b) using Struts2 i18n properties files which I don't need elsewhere and seem like overkill for just solving this problem. Is there any simple way to just turn off escaping of the label, or an escape character to indicate to not escape the ampersand? If it's not clear, I'm using JSP.

有帮助吗?

解决方案

So just write it like µ in label attribute.

<s:textfield name="measurement" label="Time Measurement (µs)" />

You can put escaped characters inside <s:textfield> tag:

<s:textfield name="measurement">
  Time Measurement (&mu;s)
</s:textfield> 
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top