webtier@glassfish.java.net

JSF Mojarra 1.2 implemenation MessageFactory

From: <webtier_at_javadesktop.org>
Date: Wed, 22 Apr 2009 05:13:12 PDT

Hello,

this post may be deprecated from start since JSF 2.0 is available.
I'm trying to learn from the JSF 1.2 Mojara implementation. I'm using mojarra-1.2_09-b02-FCS-source.zip

I saw several identical "MessageFactory" classes. They are placed whithin :
jsf-api/build/generate/javax.faces.component
jsf-api/build/generate/javax.faces.convert
jsf-api/build/generate/javax.faces.validator
jsf-api/build/generate/javax.faces.webapp

Is there a reason they are duplicated like this? Thank you very much.

Also i confronted them to the com.sun.bookstore6.util.MessageFactory indicated by the Java EE 5 tutorial
(
[i]Instead of writing your own message factory pattern, you can use the one included with the Duke’s Bookstore application. It is called MessageFactory and is located in tut-install/javaeetutorial5/examples/web/bookstore6/src/java/com/sun/bookstore6/util/[/i] - page 391 in the PDF of the tutorial
).

Here we have:

[i] protected static Application getApplication() {
        return (FacesContext.getCurrentInstance().getApplication());
    }[/i]

And in the "MessageFactory" classes in the JSF implementation there is:

[i] protected static Application getApplication() {
        FacesContext context = FacesContext.getCurrentInstance();
        if (context != null) {
            return (FacesContext.getCurrentInstance().getApplication());
        }
        ApplicationFactory afactory = (ApplicationFactory)
            FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
        return (afactory.getApplication());
    }[/i]

Why is the "ApplicationFactory" call missing in the tutorial sample.

Thanks so much for your patiance.
[Message sent by forum member 'vladbalan' (vladbalan)]

http://forums.java.net/jive/thread.jspa?messageID=343214