代码jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>country.jsp</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<s:textfield name="people" label="%{getText('language.name')}" />
</body>
</html>message_en_US.prorperties
language.name=name
language.password=passwordmessage_zh_CN.properties
language.name=名字
language.password=密码
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts><constant name="struts.custom.i18n.resources" value="message" /></struts>
网页调用的时候为什么不能国际化,那个label不能获得参数,就出现了一个文本框和”:“为什么会出现这种状况求解
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>country.jsp</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<s:textfield name="people" label="%{getText('language.name')}" />
</body>
</html>message_en_US.prorperties
language.name=name
language.password=passwordmessage_zh_CN.properties
language.name=名字
language.password=密码
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts><constant name="struts.custom.i18n.resources" value="message" /></struts>
网页调用的时候为什么不能国际化,那个label不能获得参数,就出现了一个文本框和”:“为什么会出现这种状况求解
解决方案 »
- 在线等待 Spring + ibatis 事务问题。
- tomcat我修改了又出现了setContextPropertiesRule的警告
- 用过httpclient的帮帮忙
- 求助eclipse的一个小功能
- hibernate如何插入DB时间
- ACEGI扩展基于RBAC的权限控制
- 有关hibernate映射
- 怎么将action变成自己的默认页面
- 使用TOMCAT发布网站,好象是中毒了,总是提示缓存溢出,在WEBAPP下面也多了几个空文件夹。
- bmp重启server,bean的字段都是null。(在线)
- myeclipse8.6里坑爹的javaEE5
- jsoup可以获取html的标签名称吗?能的话怎么获取啊?
language.name=名字
language.password=密码我记得 **.properties文件 中文是放不进去的,除非转码成ascii 才可以的,楼主如何做到的呢~~