Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why JSTL number format value does not support runtime expressions?

Tags:

java

jsp

jstl

I have this code:

<fmt:formatNumber type="number" 
                  maxFractionDigits="2" 
                  value="${maxAllowableAmount}" />

I have this warning in Eclipse editor:

"value" does not support runtime expressions

I tried to ignore it and run the app, but I have this runtime error:

quote symbol expected

How am I gonna deal with this?

My data comes from the database and I want to format it on my browser.

like image 260
NinjaBoy Avatar asked Nov 29 '22 09:11

NinjaBoy


1 Answers

Ensure that you are using the correct @ taglib directive. Replace:

<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>

with:

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

The /jsp makes the difference.

like image 84
Rubens Mariuzzo Avatar answered Dec 04 '22 07:12

Rubens Mariuzzo