상세 컨텐츠

본문 제목

자바 jsp 정규표현식 언어 포맷형식을 한국어와 영어로 바꾸는

관리X 과거글

by 까먹기전에 2015. 3. 19. 10:41

본문

반응형

======================실행 a.jsp===================================

<%@ page language="java" contentType="text/html; charset=EUC-KR"

    pageEncoding="EUC-KR"%>

<!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>

</head>

<body>

<a href="fmt1.jsp?lo=ko">한글</a> <a href="fmt1.jsp?lo=en">영어</a>

</body>

</html>

=======================넘어가는 fmt1.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:bundle basename="resource.msg" >

<!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>

</head>

<body>



<fmt:message key="AAA" /><br>

<fmt:message key="BBB" /><br>

</body>

</html>

</fmt:bundle>





================================msg_ko.propertis=================================================

AAA=\uC5D0\uC774

BBB=\uBE44

================================msg.properties=================================================

AAA=a

BBB=b



관련글 더보기