I have a JSP with some monetary amounts in £s. I want people viewing the same page from the US to see $ symbol instead of £s. (Forget for a moment that the values ought to be converted as well).
I am using this JSTL solution to set the locale
<c:set var="language" value="${not empty param.language ? param.language : not empty language ? language : pageContext.request.locale}" scope="session" />
<fmt:setLocale value="${language}" />
which works perfectly for output fields like this:
<fmt:formatNumber type="currency" value="${myOutputAmount}" />
but there are also some input fields that have the £ on its own before the input box, e.g.:
£<input type="text" id="myInputAmount"/>
How can I use that locale to show the relevant currency symbol instead of £?
I have searched and found solutions for iPhone, PHP, android, C# and Java. I could implement a Java solution in my JSP but the JSTL one was so neat I'm sure there must be an easy way, tapping into however that works.