- 浏览: 1119269 次
- 性别:
- 来自: 上海
-
文章分类
- 全部博客 (401)
- tomcat (7)
- win7 (13)
- stackOverflow (6)
- 1 (0)
- css (5)
- develop IDE (9)
- hibernate (16)
- struts2标签 (10)
- struts2 (25)
- 框架 (1)
- SQLserver2005 (20)
- 词汇解释 (1)
- views (1)
- eclipse (6)
- 效率提高 (12)
- 代码模块 (1)
- 源代码 (3)
- jsonplugin (5)
- ajax (2)
- json (3)
- ssis (14)
- 电脑故障 (10)
- oracle (12)
- poi;excel (5)
- sql (3)
- 正则表达式 (3)
- develop IDEk (8)
- myeclipse (14)
- win2003 (5)
- 正则表达式;js (2)
- js (27)
- 待解决 (2)
- ognl (1)
- com组件 (1)
- 游戏 (6)
- 线程 (0)
- 硬盘 (4)
- 格式化 (2)
- java (7)
- html (9)
- firebug (1)
- jquery (4)
- 文件上传下载 (1)
- vss (2)
- 触发器 (1)
- spring事务管理 (2)
- 模态对话框 (1)
- SQLserver2000 (1)
- web性能优化 (2)
- web安全 (1)
- jetty (1)
- 路由器 (1)
- ie6 (1)
- 缓存 (1)
- jsp (1)
- struts2源代码 (1)
- 方法 (1)
- uml (1)
- ie (3)
- Java日志框架 (1)
- myeclipse,oracle (1)
- freemarker (4)
- 注解 (4)
- svn (2)
- hadoop (15)
- lucene (1)
- word (1)
- spring (5)
- job (1)
- extjs (4)
- paxos (1)
- zookeeper (1)
- 分布式 (1)
- 手机故障 (2)
- maven (2)
- linux (9)
- 虚拟机 (1)
- ext (3)
- javascript (1)
- 数据库 (5)
- 多线程 (12)
- junit (2)
- utils (1)
- mybatis (4)
- Joda-Time (1)
- tftp (1)
- scala (12)
- Graphic2D (1)
- jsf (5)
- 《java并发编程实战》笔记 (16)
- storm (3)
- 设计模式 (3)
- 泛型 (2)
- 数学 (1)
- primeface (1)
- poi (5)
- 线性代数 (1)
- 动态代理 (3)
- mysql (2)
- DB2 (2)
- testNG (1)
- 虚拟机、编译器、增量发布 (1)
最新评论
-
zhouchaofei2010:
Saro 写道在log4j配置里把mapper所在包设为deb ...
mybatis出现sql异常时的日志优化-打印sql参数 -
Saro:
在log4j配置里把mapper所在包设为debug就行了,参 ...
mybatis出现sql异常时的日志优化-打印sql参数 -
pyl574069214:
...
poi Excel 水平居中 垂直居中 -
zhouchaofei2010:
杀手请杀人 写道能看到scala太难得了 谢谢
scala 下划线解析报错: missing parameter type for expanded function -
杀手请杀人:
能看到scala太难得了
scala 下划线解析报错: missing parameter type for expanded function
一、资源文件的配置(applicationResource_zh_CN.properties)
format.number = {0,number,###,###.##}
format.discount = {0,number,###.#######%}
二、struts.xml
<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.action.extension" value="do"/>
<constant name="struts.custom.i18n.resources" value="applicationResource"></constant>
<package name="lee" extends="struts-default">
<action name="NumberFormatTest_*" class="com.zzk.test.NumberFormatTest" method="{1}">
<result name="test">/test_show.jsp</result>
</action>
</package>
</struts>
三、web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- Struts2.0 study -->
<!-- 定义Struts2的FilterDispathcer的Filter -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<!-- FilterDispatcher用来初始化struts2并且处理所有的WEB请求。 -->
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
四、JavaBean: Product.java
package com.zzk.bean;
public class Product {
private String pname;
private Double price;
private Double discount; //折扣
public String getPname() {
return pname;
}
public void setPname(String pname) {
this.pname = pname;
}
public Double getPrice() {
return price;
}
public void setPrice(Double price) {
this.price = price;
}
public Double getDiscount() {
return discount;
}
public void setDiscount(Double discount) {
this.discount = discount;
}
}
五、Action:
package com.zzk.test;
import com.opensymphony.xwork2.ActionSupport;
import com.zzk.bean.Product;
public class NumberFormatTest extends ActionSupport {
private Product p;
public String init() {
p = new Product();
p.setPname("电脑");
p.setPrice(new Double(10000000000.45));
p.setDiscount(new Double(0.855678));
return "test";
}
public Product getP() {
return p;
}
public void setP(Product p) {
this.p = p;
}
}
五、JSP页面:
test.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<a href="NumberFormatTest_init.do">Test</a>
</body>
</html>
test_show.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<s:text name="format.number">
<s:param value="p.price"/>
</s:text>
<br>
<s:property value="p.pname"/>
<br>
折扣:<s:text name="format.discount">
<s:param value="p.discount"/>
</s:text>
</body>
</html>
六、显示结果:
10,000,000,000.45
电脑
折扣:85.5678%
其中:
格式百分比的格式可以由 # 号的个数去决定。
下面是从转的:
format.number ={0,number,#0.0##}
{ 参数序号(从0开始),格式类形(number|date|time|choice),格式样式(具体样式参见http://java.sun.com/docs/books/tutorial/i18n/format/decimalFormat.html)}
用 <s:date>标签....里面 FORMAT属性设定YYYY-MM-DD-hh-mm,年,月,日,小时,分.
这里讲个小技巧:把hh改成HH就是24小时制的,小写就是12小时制的
发表评论
-
struts2 下载不弹出下载对话框
2012-12-19 17:15 2174如下配置可以: <action name=&quo ... -
getResourceAsStream
2012-12-19 17:00 2576getResourceAsStream http:// ... -
struts2访问WEB-INF文件下内容
2012-11-29 17:30 48591、 WEB-INF下内容,通过浏览器下无法直接访问 2、 ... -
struts2标签判断字符串
2012-11-14 13:24 88011:<s:property value='#at ... -
struts2附件上传,大小超过最大值处理
2012-06-20 14:19 3481Action: /** * 当上传文件大小大 ... -
struts2 action resultType ajax
2012-06-06 11:17 1049概要: 如何在st ... -
数据操作后,页面alert提示例子
2012-04-19 15:16 1078在页面开头插入如下例子代码 <s:if test ... -
struts2 格式化输出日期yyyy-MM-dd
2012-03-26 11:17 18081、直接页面输出 <s:date nam ... -
defaultStack已经包含了fileUpload的拦截器。具体的action不用再另外配置fileUpload的拦截器
2012-03-19 19:42 1081struts2.0.11 的defaultStack已经包含 ... -
struts2 property 不起作用
2012-03-16 11:41 1369<s:select id="select_s ... -
s:hidden value用property标签赋值不起作用
2012-03-07 17:23 4896<s:property value="titl ... -
struts2的重定向带参数
2012-03-06 23:28 0redirect。。。。 -
jsp 调试输出值
2012-03-06 22:46 1243比如有代码 <s:if test="#gdzc ... -
struts2 ognl 传递参数原理及过程
2011-12-31 17:22 1080struts2 ognl 传递参数原理及过程 -
struts2 jsonplugin includeProperties中对list集合的正则配置
2011-12-29 21:21 36931、listAttachment.*\.realName ... -
struts2 jsonplugin includeProperties 对list集合的正则配置
2011-12-29 21:18 4897jsonplugin 0.32 0.34 官方下载 ... -
struts2的重定向与转发配置
2011-12-27 16:18 1259<result name="success&q ... -
struts2读取资源文件的方式
2011-11-27 15:24 1325(1)JSP页面:<s:text name=" ... -
struts 2数字格式化话
2011-11-27 14:41 2056--jsp页面 <s:textfield maxLen ... -
iterator标签用begin属性报错:Attribute begin invalid for tag iterator according to TLD
2011-11-12 15:14 6899iterator 标签用bgin 属性报错Attribute ...
相关推荐
Struts2-number-plugin插件是基于Apache Struts2框架的一个扩展,主要目的是为了方便开发者在Struts2应用中处理数字格式化和国际化的问题。这个插件提供了强大的功能,包括数字的格式化、货币转换以及百分比计算等。...
2,使用+运算符时,如果一边是数字,一边是字符串,就会自动将数字转换为字符串再连接,如:${3 + "5"},结果是:35 使用内建的int函数可对数值取整,如: ${ (x/2)?int } ${ 1.1?int } ${ 1.999?int } ${ -1.1?int } ...
报餐小程序前后端开源代码-微信小程序
cmd脚本-bat批处理-模拟2K开机进度条.zip
黑马程序员视频文档,带目录 SpringCloudAlibaba视频教程,深入学习Java微服务开发(SpringCloud) https://www.bilibili.com/video/BV1R7
基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统,个人经导师指导并认可通过的高分设计项目,评审分98分,项目中的源码都是经过本地编译过可运行的,都经过严格调试,确保可以运行!主要针对计算机相关专业的正在做大作业、毕业设计的学生和需要项目实战练习的学习者,资源项目的难度比较适中,内容都是经过助教老师审定过的能够满足学习、使用需求,如果有需要的话可以放心下载使用。 基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经网络的果蔬识别系统基于python tensorflow2.3的果蔬识别系统源码+模型-基于卷积神经
cmd脚本-bat批处理-set命令特殊用法.zip
cmd脚本-bat批处理-不显示扩展名.zip
cmd-bat-批处理-脚本-过滤敏感字符.zip
使用方法:拷贝到Auto CAD的Fonts下
cmd-bat-批处理-脚本-简介.zip
基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计,个人经导师指导并认可通过的高分设计项目,评审分98分,项目中的源码都是经过本地编译过可运行的,都经过严格调试,确保可以运行!主要针对计算机相关专业的正在做大作业、毕业设计的学生和需要项目实战练习的学习者,资源项目的难度比较适中,内容都是经过助教老师审定过的能够满足学习、使用需求,如果有需要的话可以放心下载使用。 基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(含源码及报告)适合期末大作业&课程设计基于Opencv与Python结合的车牌识别系统(
cmd-bat-批处理-脚本-readme.zip
使用方法:拷贝到Auto CAD的Fonts下
Linux学习与笔记记录
cmd-bat-批处理-脚本-sxs.exe 的查杀.zip
cmd脚本-bat批处理-把秒转换为天小时分秒的格式.zip
振动压路机振动轮.rar
cmd-bat-批处理-脚本-删除快捷方式的箭头.zip
cmd脚本-bat批处理-查看工作组.zip