Latest web development tutorials

<FMT : 메시지> 태그

JSP 표준 태그 라이브러리 JSP 표준 태그 라이브러리

<FMT는 : 메시지> 태그는 현지 뉴스에 키를 매핑하고 대체 매개 변수를 수행 할 수 있습니다.

구문

<fmt:message
   key="<string>"
   bundle="<string>"
   var="<string>"
   scope="<string>"/>

재산

<FMT : 메시지> 태그는 다음과 같은 특성이 있습니다 :

재산 기술 필요한 경우 디폴트 값
메시지 키를 검색하려면 아니
묶음 자원 번들을 사용하려면 아니 기본 자원 번들
VAR 변수 이름은 지역 뉴스를 저장 아니 페이지 인쇄
범위 범위 var 애트리뷰트 아니 페이지


예를 들면 데모

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
<title>JSTL fmt:message 标签</title>
</head>
<body>

<fmt:setLocale value="en"/>
<fmt:setBundle basename="com.w3big.Example" var="lang"/>

<fmt:message key="count.one" bundle="${lang}"/><br/>
<fmt:message key="count.two" bundle="${lang}"/><br/>
<fmt:message key="count.three" bundle="${lang}"/><br/>

</body>
</html>

결과는 다음과 같습니다 :

One 
Two 
Three

JSP 표준 태그 라이브러리 JSP 표준 태그 라이브러리