20160502-struts2入门--国际化
一、国际化
<constant name="struts.custom.i18n.resources" value="itcast" />
package com.dzq.action; import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport; public class ManagerAction extends ActionSupport{
@Override
public String execute() throws Exception {
ActionContext.getContext().put("message", this.getText("welcome"));
return "message";
}
}
<s:text name="welcome">
<s:param><s:property value="realname"/></s:param>
<s:param>学习</s:param>
</s:text>
package com.dzq.action; import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport; public class ManagerAction extends ActionSupport{
@Override
public String execute() throws Exception {
ActionContext.getContext().put("message", this.getText("welcome",new String[]{"liming","study"}));
return "message";
}
}
<s:i18n name="itcast">
<s:text name=“welcome”/>
</s:i18n>
<s:i18n name=“cn/itcast/action/package">
<s:text name="welcome">
<s:param>小张</s:param>
</s:text>
</s:i18n>
20160502-struts2入门--国际化的更多相关文章
- Struts2入门(六)——国际化
一.前言 1.1.国际化简介 国际化是指应用程序在运行的时候,根据客户端请求来自的国家地区.语言的不同而显示不同的界面(简单说就是根据你的地区显示相关地区的语言,如果你现在在英国,那么显示的语言就是英 ...
- Struts2的国际化入门
Struts2的国际化入门 Struts2国际化是建立在Java国际化的基础上的,一样是通过提供不同国家/语言环境的消息资源,然后通过ResourceBundle加载指定Locale对应的资源文件,再 ...
- Struts2入门2 Struts2深入
Struts2入门2 Struts2深入 链接: http://pan.baidu.com/s/1rdCDh 密码: sm5h 前言: 前面学习那一节,搞得我是在是太痛苦了.因为在Web项目中确实不知 ...
- Struts2入门1 Struts2基础知识
Struts2入门1 Struts2基础知识 20131130 代码下载: 链接: http://pan.baidu.com/s/11mYG1 密码: aua5 前言: 之前学习了Spring和Hib ...
- Struts2 入门
一.Struts2入门案例 ①引入jar包 ②在src下创建struts.xml配置文件 <?xml version="1.0" encoding="UTF-8&q ...
- Struts2入门3 深入学习
Struts2入门3 深入学习 处理结果和异常 前言: Struts学习的差不多了,还有最后的一点就收官了就是结果处理和异常处理.前面学习Struts主要围绕就是Action以及struts.xml配 ...
- 十四、Struts2的国际化
十四.Struts2的国际化 1.配置全局国际化消息资源包 配置全局消息资源包 <!--配置全局消息资源包 --> <constant name="struts.c ...
- struts2入门程序
struts2入门程序 1.示例 搭建编程环境就先不说了,这里假设已经搭建好了编程环境,并且下好了strut2的jar包,接下来程序. 1.1 新建web项目 点击File->New->D ...
- JavaWeb框架_Struts2_(八)----->Struts2的国际化
这一篇博文拖了蛮久了,现在先把它完成,结束struts2这个版块,当然这只是最基础的部分,做项目还需要更深的理解.下一个web后端的版块准备做Spring框架的学习-嗯,加油! 1. Struts2的 ...
- struts2框架(1)---struts2入门
struts2框架 如果你之前在MVC模式的时候一直都是通过servlet,获取和返回数据,那么现在开始学习struts2框架, Struts是一个实现MVC设计模式的优秀的框架.它的许多优点我就不说 ...
随机推荐
- leetcode@ [97] Interleaving Strings
https://leetcode.com/problems/interleaving-string/ Given s1, s2, s3, find whether s3 is formed by th ...
- SGU-495 Kids and Prizes 概率DP
题目链接:http://acm.sgu.ru/problem.php?contest=0&problem=495 题意:有n个盒子,每个盒子里面放了一个奖品,m个人轮流去选择盒子,如果盒子里面 ...
- 在CentOS 6.2上安装 MemcacheQ 最新版
1. 安装 yum install gcc cc make libevent libevent-devel 2. 安装Berkeley DB 下载:http://www.oracl ...
- .NET 基础 一步步 一幕幕[面向对象之静态、非静态]
静态.非静态 先来看一段代码来区分静态与非静态: using System; using System.Collections.Generic; using System.Linq; using Sy ...
- 【Stage3D学习笔记续】山寨Starling(五):纹理计算和尺寸计算
尺寸计算: Starling中的尺寸是以像素为单位的,这一切都得力于我们使用的正交矩阵,还记得我们顶点数据中的位置数据么,如果我们提交的矩形的四个顶点为(0, 0)(0, 100)(100, 0)(1 ...
- 学习和理解C#的委托
去年自学C#用的教程是入门级的<学通C#的24堂课>,教材里面也没有提到委托和事件,工作中也没怎么用到.后来一次在网上看了一些大牛的博客,读完之后感觉懵懵懂懂,似懂非懂,过了两三天之后,却 ...
- ServletContext1
---------------ConfigServlet.java----------- protected void doGet(HttpServletRequest request, HttpSe ...
- Codeforces Beta Round #96 (Div. 1) D. Constants in the language of Shakespeare 贪心
D. Constants in the language of Shakespeare Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codef ...
- AIR 程序开发系列 之五 保存数据的几种方式
Local SharedObject 这种方法比较简单方便的保存少的数据到到设备中.你不用自己去管理这些数据,设备会自动管理他. SharedObject 在 flash.net 包中,继承自Even ...
- mysqldump 备份原理9
前文的一个细节http://blog.itpub.net/29254281/viewspace-1392757/ 5.--master-data + --single-transaction 同时 ...