【问题标题】:don't work tag fmt:setBundle不工作标签 fmt:setBundle
【发布时间】:2015-04-08 17:00:34
【问题描述】:

会提示做出决定的朋友。我有教育项目。 jsp 页面的语言区域设置不起作用。我使用标准标签: 和 。我按照学生手册做了一切。 页面jsp代码:

<%@ page language="java" contentType="text/html" pageEncoding="UTF-  8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<fmt:setLocale value="en_US" scope="session" />
<fmt:setBundle basename="resources.pagecontent" />
<!DOCTYPE html>
<html>
<head>
<title><fmt:message key="tr_titlepage"/></title>
</head>
<body>
<c:import url="${uriJspHeader}" charEncoding="utf-8"/>
<br>
<h1><fmt:message key="tr_pagename"/></h1>....

我在文件夹中建立了 jar 文件。 '根/web/WEB-INF/lib/javax.servlet.jsp.jstl-1.2.1。 web/WEB-INF/lib/javax.servlet.jsp.jstl-api-1.2.1' 文件:pagecontent_ru_RU.properties,pagecontent_en_US.properties.....在文件夹中:'ROOT/web/jsp/resources'

键是真实写下来的,页面内容文件...是根据键填充的-我重新检查了很多次。但结果:'??? (钥匙)???'它出现在必须有来自文件的文本的地方。 IE。处理程序不会“看到”有限的资源。但其他标签,如'fmt:formatnumber' 工作正常。

谁知道,我做的不对???

【问题讨论】:

    标签: java jsp jstl locale


    【解决方案1】:

    一切都很简单。包含资源文件的文件夹 /resources 需要放在文件夹 /src 中,(从 basename = "resources.pagecontent" 开始)然后一切都会好的。 :))

    【讨论】:

      猜你喜欢
      • 2014-10-29
      • 1970-01-01
      • 2013-06-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-05-09
      • 2017-03-23
      相关资源
      最近更新 更多