0
JSP로 JSTL 태그를 사용하여 내 애플리케이션을 국제화하려고합니다. 내 문제는, 속성 파일의 내용이 UI에 표시되지 않는다는 것입니다.jstl 태그를 사용하여 애플리케이션 internationnalize 만들기
JSP 코드 렌더링 된 출력은
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
This Example demonstrates the basic JSTL formating tags:
<br/><br/>
Locale from client:
<b><c:out value="${pageContext.request.locale}"/></b><br/>
<fmt:setBundle basename="ApplicationResources" var="mybundle"/>
<fmt:message key="welcome.message" bundle="${mybundle}">
<fmt:param value="${param.uname}"></fmt:param>
</fmt:message>
<b>Now testing <fmt:setLocale>tag:</b><br>
Creating a ResourceBundle with client locale and setting it to <i>mybundle1</i>
variable.<br>
<fmt:setBundle basename="ApplicationResources" var="mybundle1"/>
Setting the locale to<i>it</i>(italian).<br/>
<fmt:setLocale value="it"/>
Creating a ResourceBundle with <i>it</i>(italian) locale and setting it to <i>mybundle2</i> variable.<br><br>
<fmt:setBundle basename="ApplicationResources" var="mybundle2"/>
<b>Message using <i>mybundle1</i>:</b><br>
<pre>
<fmt:message bundle="${mybundle1}" key="welcome.message">
</fmt:message>
</pre>
<br>
<b>Message using <i>mybundle2</i>:</b><br>
<pre>
<fmt:message bundle="${mybundle2}" key="welcome.message">
</fmt:message>
</pre>
</body>
</html>
:
This Example demonstrates the basic JSTL formating tags:
Locale from client: en_US
???welcome.message??? Now testing <fmt:setLocale>tag:
Creating a ResourceBundle with client locale and setting it to mybundle1 variable.
Setting the locale toit(italian).
Creating a ResourceBundle with it(italian) locale and setting it to mybundle2 variable.
Message using mybundle1:
???welcome.message???
Message using mybundle2:
???welcome.message???
[여기에 질문하는 방법]을 읽는 데 너무 친절하십니까? (http://msmvps.com/blogs/jon_skeet/archive/2010/08/29/writing-the-perfect-question. aspx)? 귀하의 질문에 심각한 서식 문제가 있으며 귀하가 무엇을 요구하고 있는지 분명하지 않습니다. 방금 문제가 있다고 하셨 잖아요. –
가능한 [자바 웹 응용 프로그램을 국제화하는 방법] (http://stackoverflow.com/questions/4276061/how-to-internationalize-a-java-web-application) – BalusC