You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Todd Patrick <To...@dtn.com> on 2006/05/10 18:16:08 UTC

message-bundle: Do I need to define my .properties file in the faces-config.xml AND the jsp file both?

Concerning a .properties file, do I need to define the .properties file
in my faces-config.xml:
 
<application>
    <locale-config>
    <default-locale>en_US</default-locale>
    </locale-config>
    <message-bundle>com.dtn.petro2.petro_admin.tbrowser</message-bundle>
</application>
 
 
*AND* in the .jsp page:
 
<f:loadBundle basename="com.dtn.petro2.petro_admin.tbrowser" var="tb"/>
 
I return the following error if I don't have the .properties file
defined in my faces-config.xml and only have it defined in my jsp file:
 
[#|2006-05-10T10:50:12.168-0500|SEVERE|sun-appserver-pe8.2|javax.enterpr
ise.system.container.web|_ThreadID=12;|ApplicationDispatcher[/transactio
nbrowser] Servlet.service() for servlet jsp threw exception

java.lang.NullPointerException: null MessageFactory
 
Thanks,
 
--Todd

Re: message-bundle: Do I need to define my .properties file in the faces-config.xml AND the jsp file both?

Posted by Bruno Aranda <br...@gmail.com>.
You should only need the loadBundle component:

<f:loadBundle basename="com.dtn.petro2.petro_admin.mymessages" var="tb"/>

And it would get the localized properties from
/com/dtn/petro2/petro_admin/mymessages.properties in the classpath.

Regards,

Bruno

On 5/10/06, Todd Patrick <To...@dtn.com> wrote:
>
> Concerning a .properties file, do I need to define the .properties file in
> my faces-config.xml:
>
> <application>
>     <locale-config>
>     <default-locale>en_US</default-locale>
>     </locale-config>
>
> <message-bundle>com.dtn.petro2.petro_admin.tbrowser</message-bundle>
> </application>
>
>
> *AND* in the .jsp page:
>
> <f:loadBundle
> basename="com.dtn.petro2.petro_admin.tbrowser" var="tb"/>
>
> I return the following error if I don't have the .properties file defined in
> my faces-config.xml and only have it defined in my jsp file:
>
> [#|2006-05-10T10:50:12.168-0500|SEVERE|sun-appserver-pe8.2|javax.enterprise.system.container.web|_ThreadID=12;|ApplicationDispatcher[/transactionbrowser]
> Servlet.service() for servlet jsp threw exception
>
> java.lang.NullPointerException: null MessageFactory
>
> Thanks,
>
>
> --Todd