<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>群英汇博客 &#187; Velocity</title> <atom:link href="http://blog.ossxp.com/tag/velocity/feed/" rel="self" type="application/rss+xml" /><link>http://blog.ossxp.com</link> <description></description> <lastBuildDate>Wed, 14 Sep 2011 03:52:03 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>velocity 未列入文档的秘密</title><link>http://blog.ossxp.com/2010/01/192/</link> <comments>http://blog.ossxp.com/2010/01/192/#comments</comments> <pubDate>Wed, 13 Jan 2010 13:06:54 +0000</pubDate> <dc:creator>崔 锐</dc:creator> <category><![CDATA[技术文章]]></category> <category><![CDATA[持续集成]]></category> <category><![CDATA[CruiseControl]]></category> <category><![CDATA[java]]></category> <category><![CDATA[Velocity]]></category><guid
isPermaLink="false">http://blog.ossxp.com/?p=192</guid> <description><![CDATA[Velocity小技巧
今天，在Velocity模板对i18n字符串进行处理，需要转换小写和将空格替换为下划线。一般情况下，从java代码中通过Context传递是最简单的，但是有的情况，不现实。在CC的模板中，就有这样的情况
下面是一个在模板中实现字符串转换的具体例子：#set( $tab_title = "#springMessage('Build.Log')" )
&#60;div id="$tab_title.toLowerCase().replace(' ', '_')" class="widget"
$log_extra_attrs&#62;
&#60;h2&#62;$tab_title&#60;/h2&#62;
&#60;span class="logfile"&#62;&#60;a
href="$req.getContextPath()/tab/build/download/log/$projectName/$logfile"&#62;#springMessage('Download.log')
&#60;/a&#62;&#60;/span&#62;
&#60;/div&#62;Velocity
Velocity是基于Java的模板引擎。它允许Web页面开发者引用Java代码中定义的方法。Web设计者可以和Java程序开发者并行开发遵循MVC模式的Web站点。这意味着，Web设计者可以将精力放在好的Web站点设计上，而Java程序开发者可以将精力放在编写代码上。Velocity将Java代码从Web页面中分离，使Web站点更具长期可维护性，并提供了一种替代JSP或PHP的方案
如果有感兴趣的可以看看 Velocity英文文档 .]]></description> <wfw:commentRss>http://blog.ossxp.com/2010/01/192/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 5/13 queries in 0.002 seconds using disk

Served from: blog.ossxp.com @ 2012-02-09 17:05:06 -->
