directive controller-name和directive controllername都可以吗

【图文】jsp_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
上传于|0|0|文档简介
大小:117.50KB
登录百度文库,专享文档复制特权,财富值每天免费拿!
你可能喜欢Directives - Apache FreeMarker Manual
Bookmarks:
You use FTL tags to call directives. In the example you have called the
list directive. Syntactically you have done it with
two tags: &#list animals as animal& and
&/#list&.There are two kind of FTL tags:
Start-tag:
&#directivename
parameters&
&/#directivename&
This is similar to HTML or XML syntax, except that the tag name
starts with #. If the directive doesn't have nested
content (content between the start-tag and the end-tag), you must use
the start-tag with no end-tag. For example you write &#if
something&...&/#if&,
but just &#include
something& as FreeMarker knows
that the include directive can't have nested
content.The format of the
parameters depends on
directivename.In fact there are two types of directives:
. For user-defined directives you use
@ instead of #, for example
&@mydirective
parameters&...&/@mydirective&.
Further difference is that if the directive has no nested content, you
must use a tag like &@mydirective
parameters /&, similarly as in
XML (e.g. &img ...
/&). But user-defined directives is an advanced topic
that will be discussed .FTL tags, like HTML tags, must be properly nested. So the code
below is wrong, as the if directive is both inside
and outside of the nested content of the list
directive:
&#list animals as animal&
&li&${animal.name} for ${animal.price} Euros
&#if user == &Big Joe&&
(except for you)
&/#list& &#-- WRONG! The &if& has to be closed first. --&
&/ul&Note that FreeMarker doesn't care about the nesting of HTML
tags, only about the nesting of FTL tags. It just sees HTML as flat
text, it doesn't interpret it in any way.If you try to use a non-existing directive (e.g., you mistype
the directive name), FreeMarker will decline to use the template and
produce an error message.FreeMarker ignores superfluous
inside FTL tags. So you
can write this:
animal[BR]
${animal.name} for ${animal.price} Euros[BR]
You may not, however, insert white-space between the
& or &/ and the directive
name.The complete list and description of all directives can be found
(but I recommend that you look
at the chapter about expressions first).
FreeMarker can be configured to use [ and
] instead of & and
& in the FTL tags and FTL comments, like
[#if user == &Big
Joe&]...[/#if]. For more
information read: .
FreeMarker can be configured so that it understands predefined
directives without # (like &if user
Joe&&...&/if&).
However we don't recommend the usage of this mode. For more
information read:【图文】第3章-JSP语法_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
第3章-JSP语法
上传于|0|0|文档简介
&&第3章-JSP语法
大小:1.00MB
登录百度文库,专享文档复制特权,财富值每天免费拿!
你可能喜欢

我要回帖

更多关于 angularjs directive 的文章

 

随机推荐