MonoRail 视频学习01(Nvelocity快速入门)
/Files/zq535228/MonoRail01.part2.rar
/Files/zq535228/MonoRail01.part3.rar
/Files/zq535228/MonoRail01.part4.rar
Nvelocity快速入门
简介
Velocity is a Java-based template engine. It permits web page designers to reference methods defined in Java code. Web designers can work in parallel with Java programmers to develop web sites according to the Model-View-Controller (MVC) model, meaning that web page designers can focus solely on creating a well-designed site, and programmers can focus solely on writing top-notch code. Velocity separates Java code from the web pages, making the web site more maintainable over the long run and providing a viable alternative to Java Server Pages (JSPs) or PHP.
Velocity是一个基于JAVA的模板引擎。可以使网页设计人员和程序员更加专注自己的工作。
Velocity can be used to generate web pages, SQL, PostScript and other output from templates. It can be used either as a standalone utility for generating source code and reports, or as an integrated component of other systems. When complete, Velocity will provide template services for the Turbine web application framework. Velocity+Turbine will provide a template service that will allow web applications to be developed according to a true MVC model.
可以用他来制作web pages, SQL, PostScript等内容。使web applications遵循MVC模式。
简单讲解一下Velocity的基本概念,然后
Web.config
定义模板文件的根目录和模板引擎的类型
定义变量
$title
$!title
${title}
$siteroot
使用#set()赋值
#set($foo = false)
#if ($foo)
foo是真是的
#elseif ($bar)
bar是真是的
#elseif (true)
foo是否定的,bar也是否定的
#end
使用layout代替ASP.NET中的MasterPage
熟悉Velocity的基本语法,创建简单的小示例头部
内容页面——左侧
主体内容
底部
浙公网安备 33010602011771号