普通字符串
action中:
request.setAttribute("hello", "helloworld");
bean_write标签:
<li>普通字符串</li><br>
hello(标签):<bean:write name="hello"/><br>
运行效果:
html文本
action中:
request.setAttribute("bj", "<font color='red'>晓儿的测试</font>");
bean_write标签:
<li>html文本</li><br>
bj(default):<bean:write name="bj"/><br>
bj(filter="true"):<bean:write name="bj" filter="true"/><br>
bj(filter="false"):<bean:write name="bj" filter="false"/><br>
运行效果:
格式化日期
action中:
request.setAttribute("today", new Date());
bean_write标签:
<li>格式化日期</li><br>
today(default):<bean:write name="today"/><br>
today(format="yyyy-MM-dd HH:mm:ss):<bean:write name="today" format="yyyy-MM-dd HH:mm:ss"/><br>
运行效果:
格式化数字
action中:
request.setAttribute("n", 12345.1234);
bean_write标签:
<li>格式化数字</li><br>
n(default):<bean:write name="n"/><br>
n(format="###,###.####"):<bean:write name="n" format="###,###.####"/><br>
n(format="###,###.00000"):<bean:write name="n" format="###,###.00000#"/><br>
运行效果: