struts第十三天--输出带占位符的资源信息
2012-10-21 18:26
357 查看
<?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="isoftstone"/>
<package name="person" namespace="/person" extends="struts-default">
<action name="manage" class="com.isoftstone.study.PersonManagerAction">
<result name="message">/WEB-INF/page/message.jsp</result>
</action>
</package>
</struts>
welcome={0}\uFF0Cwelcome to isoftstone{1}
welcome={0}\uFF0C\u6B22\u8FCE\u6765\u5230\u8F6F\u901A\u52A8\u529B{1}
package com.isoftstone.study;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class PersonManagerAction extends ActionSupport{
@Override
public String execute() throws Exception {
ActionContext.getContext().put("message", this.getText("welcome",new String[]{"wangjin","day day up!"}));
return "message";
}
}
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>国际化</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
</head>
<body>
<s:text name="welcome">
<s:param>wangjin</s:param>
<s:param>study</s:param>
</s:text>
</body>
</html>
message.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>国际化</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
</head>
<body>
<s:text name="welcome">
<s:param>wangjin</s:param>
<s:param>study</s:param>
</s:text>
</body>
</html><%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>国际化</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
</head>
<body>
<s:text name="welcome">
<s:param>wangjin</s:param>
<s:param>study</s:param>
</s:text>
</body>
</html>
<!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="isoftstone"/>
<package name="person" namespace="/person" extends="struts-default">
<action name="manage" class="com.isoftstone.study.PersonManagerAction">
<result name="message">/WEB-INF/page/message.jsp</result>
</action>
</package>
</struts>
welcome={0}\uFF0Cwelcome to isoftstone{1}
welcome={0}\uFF0C\u6B22\u8FCE\u6765\u5230\u8F6F\u901A\u52A8\u529B{1}
package com.isoftstone.study;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
public class PersonManagerAction extends ActionSupport{
@Override
public String execute() throws Exception {
ActionContext.getContext().put("message", this.getText("welcome",new String[]{"wangjin","day day up!"}));
return "message";
}
}
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>国际化</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
</head>
<body>
<s:text name="welcome">
<s:param>wangjin</s:param>
<s:param>study</s:param>
</s:text>
</body>
</html>
message.jsp
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>国际化</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
</head>
<body>
<s:text name="welcome">
<s:param>wangjin</s:param>
<s:param>study</s:param>
</s:text>
</body>
</html><%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>国际化</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
</head>
<body>
<s:text name="welcome">
<s:param>wangjin</s:param>
<s:param>study</s:param>
</s:text>
</body>
</html>
相关文章推荐
- struts2输出带有占位符的国际化信息
- 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误消息: CS0016: 未能写入输出文件“c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\41c191fd\ff9345c5\App_Web_login.cshtml.65793277
- struts2国际化---配置国际化全局资源文件并输出国际化资源信息
- 如何输出Struts资源文件中的中文
- struts2输出带有占位符的国际化信息
- Struts2 输出带有占位符的国际化信息
- 国际化全局资源文件输出国际化信息
- struts国际化和国际化输出占位符
- Struts2的国际化、配置全局资源与输出国际化信息、国际化—JSP中直接访问某个资源文件
- struts2配置国际化全局资源文件 并 输出国际化信息
- 复习struts2之输出带有占位符的国际化信息
- struts2输出带有占位符的国际化信息
- 第二十四章 配置国际化全局资源文件、输出国际化信息
- Struts 2 简单使用 log4j2(timer 拦截器不输出信息)
- 输出带有占位符的国际化信息
- 配置国际化全局资源文件、输出国际化信息
- Struts2学习笔记(十六):配置国际化全局资源文件、输出国际化信息
- struts第十三天--国际化全局访问的国家化资源
- 复习struts2之配置国际化全局资源文件、输出国际化信息
- struts2-19配置国际化全局资源文件、输出国际化信息