JSF check does not find custom class ResourceBundle

I have my own class ResourceBundle org.example.web.UILabels.java, which works fine when running the code , but the JSF editor in Eclipse does not find it, I believe that the editor / validator only searches for property files by name. It also means that I no longer get a type residing on resources that was very nice to have.

Any ideas how this can be fixed?

<f:loadBundle basename="org.example.web.UILabels" var="uiLabels"/> ... <h:outputText value="#{uiLabels.someTextValue}" /> ... 

I get an error (in the list of problems errors)

The resource package org.example.web.UILabels could not be found in the classpath

Type = JSF Problem

Eclipse3.4.0 with versions of WebStandardTools

  • Version: 1.4.0.v200802280619-13-7w311917141518
  • Version: 1.5.1.v200802280619-1407w311917141519
  • Version: 3.0.0.v200806092130-7A-8Y8QqN2lf4VSWrI2ek5Pf4k7s

For more information on why I use the ResourceBundle class, and not just the properties file, see Question 653682 how-to override-some-resources-from-a-propertyresourcebundle

Thank you for your time, David Waters.

+4
source share
2 answers

The resource-bundle element is more efficient than the f: loadBundle action, since a package can be created once for the entire application. However, its function is JSF 1.2, and if you want to be compatible with JSF 1.1, you must use JSF 1.1. Here is an example if you are using JSF 1.2: Define this in your faces-config.xml as follows:

 <application> <resource-bundle> <base-name>org.example.web.UILabels</basename> <var>uiLabels</var> </resource-bundle> </application> 

Sorry to not answer your question, but I have no experience with Eclipse. I also misunderstood your question, so Ive edited my original answer.

+3
source

I had the same problem, I finally found this solution: Eclipse is only looking for default properties, your project should have properties without a locale, for example:

 <f:loadBundle basename="i18n.messages" var="msg" /> 

Eclipse will only search for " i18n/messages.properties ".

+2
source

All Articles