View Single Post
  #3 (permalink)  
Old September 28th, 2003, 06:58 AM
raustin raustin is offline
Registered User
 
Join Date: Sep 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this :

<%@ taglib prefix="fmt_rt" uri="http://java.sun.com/jstl/fmt_rt" %>
<html>
    <head>
        <title>Using a JavaBean</title>
    </head>
    <body>

    <h2>Using a JavaBean</h2>

    <jsp:useBean id="myCar" class="com.wrox.cars.CarBean" />

    I have a <jsp:getProperty name="myCar" property="make" /> <br />
      My car costs <fmt_rt:formatNumber value="${myCar.price}"
                                        type="currency" />

    </body>
</html>

In the book I add _rt to all the taglib prefixes ie

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

and then when the prefix gets used also make the same change i.e

My car costs <fmt:formatNumber value="${myCar.price}"
becomes
My car costs <fmt_rt:formatNumber value="${myCar.price}"

I've had to to this to every example that uses the fmt,c or sql taglibs.

Hope the above helps..




Reply With Quote