java有没有类似zope的ZPT(page template)实现?
最近接触了一下zope,它有一个page template技术,类似于jsp中的标签库,但它是做为html标签属性出现的。例:
jsp的:
<%
if(a==3){
%>
<a href="search.jsp?key=<%=key%>">搜索</a>
<%
}
%>
jsp的tagLib类似:
<logic:equal name="a" value="3">
<a href="search.jsp?key=<bean:write name="key" />">搜索</a>
</logic:equal>
用ZPT是:
<a href="" tal:condition="python:a==3" tal:attribute="href string:search.jsp?key=${key}">搜索</a>
ZPT的优点一目了然。
对于动态生成页面技术,jakarta的velocity是最接近我需求的。我需要的是一种简单且强大的嵌入技术(flexible!)。对于jsp,因为它过于强大,使得实现mvc模式需要人为控制,velocity是逻辑上的弱化和表现上的强化的jsp样式。
标签库十分不爽!学起来麻烦,写起来麻烦!还被人标榜为简单应用的典范!!!
请各位老大指点一下有什么好的技术可以支持类似的ZPT的语法?
真没有的话,谁有时间写一个让大家用吧,和实现jsp差不多吧,写个servlet,也不是不可行。
zpt的文档链接:
http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ZPT.stx
http://zope.org/Documentation/Books/ZopeBook/2_6Edition/AdvZPT.stx
问题点数:0、回复次数:2Top
1 楼liusong1234(刘松)回复于 2003-12-02 17:33:51 得分 0
我找到了!
http://javazpt.sourceforge.net/
刚下下来还没来得及看,上面说是GPL协议的,没有实现metal,还是不大爽。
哪个老大留个言,我好结帖。
Top
2 楼liusong1234(刘松)回复于 2003-12-02 18:10:00 得分 0
转一些帖子:
Of course, one must learn Python and ZPT... Incidentally, I recently compared ZPT to JSP/JSTL/JavaServer
Faces and was appalled at the cruftiness of the Java solutions. ZPT is *way* cleaner and easier.
Learn ZPT and you will understand where JSP technology might be in two years. ...
I did not consider the other frameworks you mentioned. One of my
biggest concerns was a large and active user/contributor
base, and copious documentation. Check out the zope.org site, and you
will observe new Zope plugins getting created at a rate of several per week.
Few other platforms can match that: Perl, PHP, Java, Microsoft. I
prefer a real language, so PHP is out. I prefer Python to
Perl, so that's out. Java is great for the back-end, but too cumbersome
and verbose for the front end. I want to avoid
lockin, so Microsoft is out. That leaves Python/Zope by a process of
elimination!
Top




