当前位置: 首页 > news >正文

义乌网站建设推广专家wordpress 语言设置

义乌网站建设推广专家,wordpress 语言设置,流量查询,app软件推广怎么做首先介绍日期的格式化:(不要嫌多哦) JSTL格式化日期#xff08;本地化#xff09; 类似于数字和货币格式化#xff0c;本地化环境还会影响生成日期和时间的方式。 % page pageEncodingUTF-8 %% taglib prefixc urihttp://java.su…首先介绍日期的格式化:(不要嫌多哦) JSTL格式化日期本地化 类似于数字和货币格式化本地化环境还会影响生成日期和时间的方式。 % page pageEncodingUTF-8 %% taglib prefixc urihttp://java.sun.com/jsp/jstl/core %% taglib prefixfmt urihttp://java.sun.com/jsp/jstl/fmt % htmlheadtitleDate Formatting/title/headbodyh1Date Formatting and locale/h1fmt:timeZone valueESTjsp:useBean idcurrentTime classjava.util.Date/ h3English, Great Britain/h3fmt:setLocale valueen_GB /fmt:formatDate typeboth dateStylefull timeStylefull value${currentTime} /br/ h3English, USA/h3fmt:setLocale valueen_US /fmt:formatDate typeboth dateStylefull timeStylefull value${currentTime} /br/ h3French, France/h3fmt:setLocale valuefr_FR /fmt:formatDate typeboth dateStylefull timeStylefull value${currentTime} /br/ h3Japanese, Japan/h3fmt:setLocale valueja_JP /fmt:formatDate typeboth dateStylefull timeStylefull value${currentTime} /br/ h3Korean, Korea/h3fmt:setLocale valueko_KR /fmt:formatDate typeboth dateStylefull timeStylefull value${currentTime} /br/ h3Spanish, Spain/h3fmt:setLocale valuees_ES /fmt:formatDate typeboth dateStylefull timeStylefull value${currentTime} /br/ h3Arabic, Egypt/h3fmt:setLocale valuear_EG /fmt:formatDate typeboth dateStylefull timeStylefull value${currentTime} /br/ /fmt:timeZone/body/html fmt:formatDate动作的属性 type: 可以是timedate或both。控制是否只生成时间只生成日期或者时间日期都生成。 dateStyle: 可以是short, medium, long 或 full(default)。控制打印日期使用的具体格式。 timeStyle: 可以是short, medium, long 或 full(default)。控制打印时间使用的具体格式。 value: 这是一个java.util.Date 类型的值用于生成日期和时间。 jstl格式化日期标签 JSP Standard Tag Libraries Formatting and Internationalization Two form input parameters, date and isoDate, are URL-encoded in the link leading to this page. isoDate is formatted according to the ISO8601 standard. Formatting of numbers and dates is based on the browsers locale setting. Formatting will change if you switch the default language setting from English to French or German, for example. (The browser needs to be restarted, too.) Library import and parameter capturing: % taglib prefixc urihttp://java.sun.com/jstl/core % % taglib prefixfmt urihttp://java.sun.com/jstl/fmt % fmt:parseDate value${param.date} vardate patternyyyy/MM/dd:HH:mm:ss fmt:parseDate value${param.isoDate} varisoDate patternyyyyMMddTHHmmss The input parameters must match the patterns, or the JSP will thrown an exception. This page does no error handling. Input parameters: Date:     2004/04/01:13:30:00    Java format: Thu Apr 01 13:30:00 CST 2004 isoDate: 20040531T235959        Java format: Mon May 31 23:59:59 CDT 2004 Dates Tag Output Attribute: value; required. Tag has no body. (type默认是date)fmt:formatDate value${date} typeboth/ 2004-4-1 13:30:00   fmt:formatDate value${isoDate} typeboth/ 2004-5-31 23:59:59   Attribute: type; optional. Indicates what to print: date, time, or both. fmt:formatDate value${date} typedate/ 2004-4-1   fmt:formatDate value${isoDate} typetime/ 23:59:59   Attribute: dateStyle; optional. Varies the date format. 默认是mediumfmt:formatDate value${isoDate} typedate dateStyledefault/ 2004-5-31   fmt:formatDate value${isoDate} typedate dateStyleshort/ 04-5-31   fmt:formatDate value${isoDate} typedate dateStylemedium/ 2004-5-31   fmt:formatDate value${isoDate} typedate dateStylelong/ 2004年5月31日   fmt:formatDate value${isoDate} typedate dateStylefull/ 2004年5月31日 星期一   Attribute: timeStyle; optional. Varies the time format. 默认是mediumfmt:formatDate value${isoDate} typetime timeStyledefault/ 23:59:59   fmt:formatDate value${isoDate} typetime timeStyleshort/ 下午11:59   fmt:formatDate value${isoDate} typetime timeStylemedium/ 23:59:59   fmt:formatDate value${isoDate} typetime timeStylelong/ 下午11时59分59秒   fmt:formatDate value${isoDate} typetime timeStylefull/ 下午11时59分59秒 CDT   Attribute: pattern; optional. Inidcates date/time custom patterns. fmt:formatDate value${date} typeboth patternEEEE, MMMM d, yyyy HH:mm:ss Z/ 星期四, 四月 1, 2004 13:30:00 -0600   fmt:formatDate value${isoDate} typeboth patternd MMM yy, h:m:s a zzzz/  JSTL中数字的格式化  显示$12.00fmt:formatNumber value12 typecurrency pattern$.00/  br/显示$12.0fmt:formatNumber value12 typecurrency pattern$.#/ br/ 12.0 fmt:formatNumber value12 typecurrency pattern.00/ br/12.00元fmt:formatNumber value12 typecurrency pattern#0.00元/ br/12.00 fmt:formatNumber value12 typecurrency/  (那个货币的符号和当前web服务器的 local 设定有关)br/123456.79fmt:formatNumber value123456.7891 pattern#0.00/  br/123,456.79fmt:formatNumber value123456.7891 pattern#,#00.00/ br/ .79 fmt:formatNumber value0.7891 pattern#.00/  br/12.34%fmt:formatNumber value0.1234 typepercent pattern#0.00%/br/1,200%fmt:formatNumber value12 typepercent  /br/1200.00%fmt:formatNumber value12 typepercent pattern#0.00%/br/------------------------------------------------------------------------------java格式化输出DecimalFormat df new DecimalFormat(格式);String fmt df.format(double);符号                  意义0                     一个数位#                     一个数位前导零和追尾零不显示.                      小数点分割位置                     组分隔符的位置-                      负数前缀%                    用100乘并显示百分号其他任何符号    在输出字符串中包括指定符号 其他fmt标签的使用说明: formatting标签库:就是用于在 JSP 页面中做国际化格式化的动作分为了两类分别是                                                                                                  国际化核心标签:fmt:setLocale、fmt:bundle、fmt:setBundle、fmt:message、fmt:param、fmt:requestEncoding格式化标签:fmt:timeZone、fmt:setTimeZone、fmt:formatNumber、fmt:parseNumber、fmt:formatDate、fmt:parseDate1.fmt:setLocale标签:用于设置本地化环境属性描述 value:Locale 环境的指定可以是 java.util.Locale 或 String 类型的实例 scope:Locale 环境变量的作用范围可选 如:    设置本地环境为繁体中文    fmt:setLocale valuezh_TW/    设置本地环境为简体中文    fmt:setLocale valuezh_CN/2.fmt:requestEncoding标签:用于为请求设置字符编码它只有一个属性 value 在该属性中可以定义字符编码。 如    fmt:requestEncoding valueGB2312/3.fmt:bundle 、 fmt:setBundle 标签:用于资源配置文件的数据来源3.1fmt:bundle 标签将资源配置文件绑定于它标签体中的显示属性描述basename:资源配置文件的指定只需要指定文件名而无须扩展名prefix:前置关键字如:资源文件中配置的数据为:label.backcolor#FFFlabel.fontcolor#000则,可以用如下方法取得label的backcolor和fontcolor值:    fmt:bundle basenameMyResourse prefixlabel.         fmt:message keybackcolor /        fmt:message keyfontcolor /    /fmt:bundle3.2fmt:setBundle 标签则允许将资源配置文件保存为一个变量在之后的工作可以根据该变量来进行属性描述 二组标签共有的属性 var:fmt:setBundle 独有的属性用于保存资源配置文件为一个变量 scope:变量的作用范围 如:    查找一个名为 applicationMessage_zh_CN.properties 的资源配置文件来作为显示的 Resource 绑定    fmt:setBundle basenameapplicationMessage varapplicationBundle/ 4.fmt:message 标签:用于显示资源配置文件信息(该资源文件必须遵循如下格式: 1.扩展名必须为properties,2.文件的内容必须依照key value的格式;3.文件要放到WEB-INF/classes目录下)属性描述 key:资源配置文件的“键”指定 bundle:若使用 fmt:setBundle 保存了资源配置文件该属性就可以从保存的资源配置文件中进行查找 var:将显示信息保存为一个变量 scope:变量的作用范围 如:1)用fmt:setBundle标签将applicationMessage资源配置文件被赋于了变量applicationBundle    用fmt:message标签显示由fmt:setBundle标签保存的资源配置文件中键为passWord的信息            fmt:setBundle basenameapplicationMessage varapplicationBundle/         fmt:message keypassWord bundle${applicationBundle} /2)用fmt:bundle标签定义的applicationAllMessage资源配置文件作用于其标签体内的显示    用fmt:message标签显示applicationAllMessage资源配置文件中键为userName的信息        fmt:bundle basenameapplicationAllMessage             fmt:message keyuserName /        /fmt:bundle5.fmt:param 标签:用于参数传递fmt:param标签应该位于 fmt:message 标签内将为该消息标签提供参数值。它只有一个属性value 如在MyResourse.properties文件中,有一个索引值如下(其中,{0}代表占位符):Str2Hi,{0} 则,使用fmt:param标签传入值如下:    fmt:bundle basenameMyResourse         fmt:message keyStr2            fmt:param value张三 /        /fmt:message    /fmt:bundle也可以在资源文件中指定参数的类型:如:在MyResourse.properties文件中,有一个索引值如下:Str3{0,date}则,使用fmt:param标签传入值如下:    % request.setAttribute(now,new Date()); %    fmt:bundle basenameMyResourse         fmt:message keyStr3            fmt:param value${now} /        /fmt:message    /fmt:bundle6.fmt:timeZone、fmt:setTimeZone标签:用于设定时区fmt:timeZone 标签将使得在其标签体内的工作可以使用该时区设置fmt:setTimeZone 标签则允许将时区设置保存为一个变量在之后的工作可以根据该变量来进行属性描述 value:时区的设置 var:fmt:setTimeZone 独有的属性用于保存时区为一个变量 scope:变量的作用范围 7.fmt:formatNumber标签:用于格式化数字属性描述 value:格式化的数字,该数值可以是 String 类型或 java.lang.Number 类型的实例 type:格式化的类型,可能值包括:currency货币、number数字和percent百分比pattern:格式化模式 var:结果保存变量 scope:变量的作用范围 maxIntegerDigits:指定格式化结果的最大值 minIntegerDigits:指定格式化结果的最小值 maxFractionDigits:指定格式化结果的最大值带小数 minFractionDigits:指定格式化结果的最小值带小数 如:    结果将被保存在“ money ”变量中将根据 Locale 环境显示当地的货币格式        fmt:formatNumber value1000.888 typecurrency varmoney/8.fmt:parseNumber 标签:用于解析数字属性描述 value:将被解析的字符串 type:解析格式化的类型 pattern:解析格式化模式 var:结果保存变量类型为 java.lang.Number scope:变量的作用范围 parseLocale:以本地化的形式来解析字符串该属性的内容应为 String 或 java.util.Locale 类型的实例 如:    将15%转换为数字        fmt:parseNumber value15% typepercent varnum/ 9.fmt:formatDate标签:用于格式化日期属性描述value:格式化的日期该属性的内容应该是 java.util.Date 类型的实例type:格式化的类型pattern:格式化模式var:结果保存变量scope:变量的作用范围timeZone:指定格式化日期的时区10.fmt:parseDate标签:用于解析日期属性描述 value:将被解析的字符串 type:解析格式化的类型 pattern:解析格式化模式 var:结果保存变量类型为 java.lang.Date scope:变量的作用范围 parseLocale:以本地化的形式来解析字符串该属性的内容为 String 或 java.util.Locale 类型的实例 timeZone:指定解析格式化日期的时区  转载于:https://www.cnblogs.com/Ant-soldier/p/5051873.html
http://www.pierceye.com/news/376963/

相关文章:

  • 网站建设实习收获青岛网上房地产网站
  • 简述电子政务网站设计的技术企业邮箱是什么类型的账户
  • 深圳网站建设公司元嘉定网站开发
  • 佛山外贸网站建设平台上传网站安装教程
  • c2c网站建设实例德国网站建设
  • 建网站支持设备是什么意思佛山中小企业网站建设
  • 网站建设与管理读后感宁德住房和城乡建设部网站
  • 贸易网站建站建设部网站社保联网
  • 住房城乡建设厅网站准考证如何建小企业网站
  • 葫芦岛市城乡建设局网站做什么样的网站
  • 铜山区规划建设局网站大学生心理咨询网站建设论文
  • 泸州本地网站建设扬州做网站公司
  • 镇江网站建设工作室怎么购买国外的域名
  • 广西南宁电商网站建设找客户信息的软件
  • 信阳网站开发公司2022中国互联网公司市值排名
  • 巨鹿县住房与城乡建设厅网站wordpress内容付费插件
  • 网站设计建设维护wordpress 仿搜狗百科
  • 做网站写的代号好跟不好的区别中国500强企业官网
  • html个人网站wordpress 后台 字数统计
  • 网站开发包括哪些技术网站后台框架模版
  • 济南地产行业网站开发长春网络推广
  • 网站建设全程揭秘网站建设费能抵扣吗
  • 网站开发用什么语言最安全网站的ftp在哪里可以查到
  • 物理结构网站我国网站建设现状
  • 毕设如何做网站tk网站免费
  • 做logo的著名网站一起做网商网站怎么样
  • 楼盘销售管理网站开发资源网站界面设计形考
  • 哪个网站做视频挣钱网络推广方案下拉管家微xiala11
  • 天津营销型网站建设费用来宾绍兴seo网站托管方案
  • 哈尔滨网站制作工程上海网站快速优化排名