문제

I am using a database to hold all text values of my web pages so i can switch between different languages. I added JSF 2.0 to my project but failed when i tried to get the validation messages from my database too. Is there a way to write my own validation-messagesource which retrieves the messages from a database?

I'd really appreciate any help!

Thank you all in advance,

best regards, Robert

도움이 되었습니까?

해결책

You could extend java.util.ResourceBundle and put something like this in faces-config.xml:

<application>
    <locale-config>
        <default-locale>en</default-locale>
    </locale-config>
    <message-bundle>package.MyResourceBundle</message-bundle>
    <resource-bundle>
        <base-name>package.MyResourceBundle</base-name>
        <var>msg</var>
    </resource-bundle>
</application>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top