Hello, I am trying to internationalizate a web applicacion. For that, I set up:
application-context.xml
faces-config.xmlCode:<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basename" value="MessagesBundle" /> <property name="cacheSeconds" value="0" /> </bean>
Code:.... <application> <locale-config> <default-locale>en_EN</default-locale> <supported-locale>en_EN</supported-locale> <supported-locale>fr_FR</supported-locale> <supported-locale>de_DE</supported-locale> <supported-locale>es_ES</supported-locale> </locale-config> <resource-bundle> <base-name>javabeat.net.messages.Messages</base-name> <var>msg</var> </resource-bundle> </application> ...... <managed-bean> <managed-bean-name>MessagesBundle</managed-bean-name> <managed-bean-class>org.springframework.context.support.ReloadableResourceBundleMessageSource</managed-bean-class> <managed-bean-scope>request</managed-bean-scope> </managed-bean>
Messages.bundle which is in /WEB-INF/messages. I think maybe the error is here, in the basename, maybe I must write a hole path, but I am nor sure about this and tryed different options with no succes result.
Severals MessagesBundle_es_ES.properties in different languajes which are also in /WEB-INF/messagesCode:<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%> <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%> <f:loadBundle basename="javabeat.net.messages.Messages" var="MessagesBundle"/> <html> <body> <f:view> <h:form> <h:outputText value="#{MessagesBundle.email}"/> </h:form> </f:view> </body> </html>
email=Dirección de correo electrónico
And in my code, in a loggin.xhtml for instance, I have something like this:
But I don't get any result when I display the page. What am I doing wrong'?HTML Code:<h:outputText value="#{MessagesBundle.email}"/>
Thansk in advance


Reply With Quote
