Trying to show the currency symbol in JSP but I don't see it. Did my research and I just don`t know what more should I add to get it working. This is what I have.
<mvc:annotation-driven />
Controller
@NumberFormat(style = Style.CURRENCY)
private Double value = 50.00;
@ModelAttribute("value")
@NumberFormat(style = Style.CURRENCY)
public Double getValue() {
return value;
}
@RequestMapping(method = RequestMethod.GET)
public ModelAndView loadForm(@ModelAttribute("user") User user) {
ModelAndView instance
modelAndView.addObject("value", 100.00);
return modelAndView;
}
JSP
<spring:bind path="value">
<input type="text" name="${value}" value="${value}"/>
</spring:bind>
<spring:bind path="value">
${value}
</spring:bind>
Output
<input type="text" name="value" value="100.0"/>
100.0