zoukankan      html  css  js  c++  java
  • 【JavaEE企业应用实战学习记录】struts国际化

     1 <%--
     2   Created by IntelliJ IDEA.
     3   User: Administrator
     4   Date: 2016/10/6
     5   Time: 16:26
     6   To change this template use File | Settings | File Templates.
     7 --%>
     8 <%@ page contentType="text/html;charset=UTF-8" language="java" %>
     9 <%@taglib prefix="s" uri="/struts-tags" %>
    10 <html>
    11 <head>
    12     <title><s:text name="loginPage"/>></title>
    13 </head>
    14 <body>
    15 <s:form action="login">
    16     <s:textfield name="username" key="user"/>
    17     <s:textfield name="password" key="pass"/>
    18     <s:submit key="login"/>
    19 </s:form>
    20 </body>
    21 </html>
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <!--struts.xml配置文件-->
     3 <!DOCTYPE struts PUBLIC
     4         "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
     5         "http://struts.apache.org/dtds/struts-2.3.dtd">
     6 <!--指定Struts2配置文件的根元素-->
     7 <struts>
     8     <!--指定全局国际化资源文件-->
     9     <constant name="struts.custom.i18n.resources" value="mess"/>
    10     <!--指定国际化编码所使用的字符集-->
    11     <constant name="struts.i18n.encoding" value="utf-8"/>
    12 </struts>

    base名为mess所以我们还要提供一个mess.properties和messa_zh_CN.properties文件

    loginPage=登录页面
    errorPage=错误页面
    succPage=成功页面
    failTip=对不起,您不能登录
    succTip=欢迎,{0}您已经登录
    user=用户名
    pass=密码 
    login=登录
     1 loginPage=u767bu9646u9875u9762
     2 errorPage=u9519u8befu9875u9762
     3 succPage=u6210u529fu9875u9762
     4 failTip=u5bf9u4e0du8d77uff0cu60a8u4e0du80fdu767bu5f55uff01
     5 succTip=u6b22u8fceuff0c{0},u60a8u5df2u7ecfu767bu5f55uff01
     6 user=u7528u6237u540d
     7 pass=u5bc6  u7801
     8 login=u767bu9646
     9 user.required=u7528u6237u540du5fc5u987bu8f93u5165uff01
    10 pass.required=u5bc6u7801u5fc5u987bu8f93u5165uff01

  • 相关阅读:
    ubuntu基本配置学习(1)
    UITabBarController使用详解
    Could not find a storyboard named 'Main' in bundle NSBundle </Users/tianxiao/
    检查更新功能
    SDWebImage手动清除缓存的方法
    错误记录1
    如何获取path路径
    iOS如何获得本地Documents下的文件夹名称或文件名称
    重头系统的学习,不会咱就学!2014.6.18
    错误1
  • 原文地址:https://www.cnblogs.com/dream-to-pku/p/5934110.html
Copyright © 2011-2022 走看看