関連する資産

msg-01.png

faces-config.xml

<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.0"
    xmlns="http://java.sun.com/xml/ns/javaee" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
    
    <application>
        <locale-config>
            <default-locale>ja</default-locale>
            <supported-locale>en</supported-locale>
        </locale-config>
        <resource-bundle>
            <base-name>com.example.jsfexam.messages</base-name>
            <var>msg</var>
        </resource-bundle>
    </application>

</faces-config>

message_ja.properites, message_en.properties

index.xhtml

msg-02.png
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
        <h:outputText value="#{msg.hello}" />
        <br />
        <h:outputFormat value="#{msg['message.param']}" escape="false">
	    	<f:param value="JSF2.1" />
	    	<f:param value="PrimeFace" />
        </h:outputFormat>
        <br />
        <h:link outcome="welcomePrimefaces" value="Primefacesようこそページ" />
    </h:body>
</html>

国際化

ManagedBean? からメッセージ定義を参照する


Glassfish JSF2


添付ファイル: filemsg-05.png 1709件 [詳細] filemsg-03.png 1720件 [詳細] filemsg-04.png 1747件 [詳細] filemsg-02.png 1781件 [詳細] filemsg-01.png 1676件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS   sitemap
Last-modified: 2013-06-09 (日) 22:25:57 (3963d)
Short-URL: https://at-sushi.com:443/pukiwiki/index.php?cmd=s&k=0e727f8cb3
ISBN10
ISBN13
9784061426061