分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 技术分享

jsp:jstl标签库国际化 fmt

发布时间:2023-09-06 01:38责任编辑:白小东关键词:jsjsp

首先资源文件目录是:src/man/sources (这是它默认的资源文件)

i18n_en_US.properties文件内容

copyright=Copyright \u00A9 2013language=languagebookname=HTTP by picture

  

jsp内容,因为资源文件还有一层目录,所以bundle的basename需要加上这层目录:i18n.i18n

i18n(目录).i18n开头名

<%@ 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><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Insert title here</title></head><body><!--指定区域语言--><fmt:setLocale value="en_US"/><!-- 指定使用basename为globalMessages的资源文件,也即资源文件第一个单词为globalMessages--><fmt:bundle basename="i18n.i18n"><fmt:message key="language"></fmt:message><fmt:message key="bookname"></fmt:message></fmt:bundle></body></html>

  

jsp:jstl标签库国际化 fmt

原文地址:https://www.cnblogs.com/achengmu/p/8324667.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved