Thursday, September 25, 2008

BigDecimal converters

After today it looks as if choosing to use BigDecimal (for whatever reason) may have a challenge with regard to having both automated conversion and using a pattern to format your numbers.

So it sounds like it is time create a custom converter which extends the BigDecimal converter from JSF, and putting numeric patterns on top of it.

I will let you know how it goes...

...OK: it went well: I discovered that the creators of the application I am working on had already created such a converter. So I just use f:converter component, and reference the id of this component that was created; since the custom converters must be registered in faces-config.xml, you can just get the id from there if you are utilizing a pre-existing custom converter.

It turns out this converter hard-coded the format string. So I just loaded the resource bundle with the format string in it and use that instead. That way there is only once source in the application for the desired format string.

Saturday, September 13, 2008

Going Backwards/Forwards Simultaneously

Hi, y'all!

I just started reading the JSF Complete Reference by Schalk and Burns. I really did not want to do the examples using Tomcat since I am having a love affair with oc4j ;-) I also wanted to use JDeveloper. Oddly enough the authors really did not give much of a clue as to how to do plain ol' JSF within JDeveloper. The book seems to really want you to use the ADF stuff.

That's fine, but I am trying to learn the JSF stuff now that I have grown up on ADF stuff. I want to see what I missed.

So I now know what jar's I really need to make OC4J run on JDev and to be able to do JSF:
1. The normal stuff: commons-beanutils.jar, commons-digester.jar, commons-collections.jar, commons-logging.jar, commons-validator.jar, jsf-impl.jar, jsf-api.jar, jstl.jar, standard.jar,
2. The oc4j and servlet stuff: The rest of what you need is wrapped in something called JSP Runtime. This has the following jars: ojsp.jar, ojsputil.jar, oc4j.jar, oc4j-internal.jar, servlet.jar, and ojc.jar.

If you are working through this same book, the rest is in the book.