struts2输出带有占位符的国际化信息
2012-07-25 16:29
447 查看
index.jsp:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <%@ taglib uri="/struts-tags" prefix="s" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'index.jsp' starting page</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="greeting"> <s:param>zhangsan</s:param> <s:param>have fun</s:param> </s:text> </body> </html>
user.java:
package blog.i18n; import com.opensymphony.xwork2.ActionContext; import com.opensymphony.xwork2.ActionSupport; public class User extends ActionSupport { public String execute(){ ActionContext.getContext().put("wel", this.getText("greeting",new String[]{"lisi","have fun"})); return "success"; } }
相关文章推荐
- Struts2_输出带有占位符的国际化信息
- Struts2 输出带有占位符的国际化信息
- struts2输出带有占位符的国际化信息
- struts2输出带有占位符的国际化信息
- 复习struts2之输出带有占位符的国际化信息
- 输出带有占位符的国际化信息
- struts2国际化---配置国际化全局资源文件并输出国际化资源信息
- 复习struts2之配置国际化全局资源文件、输出国际化信息
- struts2配置国际化全局资源文件 并 输出国际化信息
- Struts2的国际化、配置全局资源与输出国际化信息、国际化—JSP中直接访问某个资源文件
- struts2-19配置国际化全局资源文件、输出国际化信息
- 3.10.3: Struts2的国际化---输出带占位符的国际化消息
- struts2输出国际信息
- javaweb简单实现国际化信息输出(参考)
- Struts2配置国际化信息
- 用struts2 action type=plaintext直接输出文本信息
- extremecomponents使用struts2国际化信息的方法
- 在Struts2的action类的方法中直接输出文本信息
- Java 基础小知识一: 使用ResourceBundle 和 MessageFormat 实现国际化信息输出
- struts2 配置带占位符国际化资源(全局)