주소창입력:http://localhost:8090/localeTest/fmt4.jsp?lo=en
fmt4.jsp
===============================
<%@ page language="java" contentType="text/html; charset=EUC-KR"
pageEncoding="EUC-KR"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:setLocale value="${param.lo}" />
<fmt:setBundle var="member" basename="a.b.member" />
<fmt:setBundle var="emp" basename="a.b.emp" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
<style type="text/css">
table { width:500px; height:300px; }
td { border:2px solid navy; }
</style>
</head>
<body>
<fmt:message bundle="${member}" key="TITLE" var="memberTitle"/>
<fmt:message bundle="${member}" key="ADDBUTTON" var="memberAddButton"/>
<fmt:message bundle="${member}" key="REMOVEBUTTON" var="memberRemoveButton"/>
<fmt:message bundle="${emp}" key="TITLE" var="empTitle"/>
<fmt:message bundle="${emp}" key="ADDBUTTON" var="empAddButton"/>
<fmt:message bundle="${emp}" key="REMOVEBUTTON" var="empRemoveButton"/>
<table>
<tr>
<td>
${memberTitle}<p>
<input type="button" value="${memberAddButton}">
<input type="button" value="${memberRemoveButton}">
</td>
<td>${empTitle}<p>
<input type="button" value="${memberAddButton}">
<input type="button" value="${memberRemoveButton}">
</td>
</tr>
</table>
</body>
</html>
a.b.emp_ko.properties
======================
TITLE=\uC9C1\uC6D0 \uBAA9\uB85D
ADDBUTTON=\uC9C1\uC6D0 \uCD94\uAC00
REMOVEBUTTON=\uC9C1\uC6D0 \uC0AD\uC81C
a.b.emp.properties
======================
TITLE=Emp List
ADDBUTTON=Emp Add
REMOVEBUTTON=Emp Remove
a.b.member_ko.properties
======================
TITLE=\uD68C\uC6D0 \uBAA9\uB85D
ADDBUTTON=\uD68C\uC6D0 \uCD94\uAC00
REMOVEBUTTON=\uD68C\uC6D0 \uC0AD\uC81C
a.b.member.properties
======================
TITLE=Member List
ADDBUTTON=Member Add
REMOVEBUTTON=Member Remove
'개발하자 > JSP&Servlet' 카테고리의 다른 글
프로젝트 경로 pageContext.request.contextPath (0) | 2015.03.20 |
---|---|
filter 필터 (0) | 2015.03.19 |
텍스트필드 입력값 다음페이지로 넘기기 (0) | 2015.03.19 |
언어 클릭시 나라별 언어로 번역하기 EL사용 (0) | 2015.03.19 |
국제화태그 setLocale 언어설정하기 (0) | 2015.03.19 |