#set $title = "The Page Title" #parse "header.wm" Your content here #parse "footer.wm"
这里对设计者来说没有要牢记的分号或对title的定义, .wm文件可以放在可自定义的搜索路径下。
问题 #4: 很粗的循环
在JSP中循环很困难。这里是用JSP重复打印出每一个ISP对象名字。 <% Enumeration e = list.elements(); while (e.hasMoreElements()) { out.print("The next name is "); out.println(((ISP)e.nextElement()).getName()); out.print("<br>"); } %>
也许什么时候会有用户自定义标记来做这些循环。对"if"也是如此。JSP页可能看上去成了很古怪的java代码。而同时,webmacro循环很漂亮: #foreach $isp in $isps { The next name is $isp.Name <br> }
<% count %> tomcat给出: work/8080/_0002ftest_0002ejsptest_jsp_0.java:56: Class count not found in type declaration. count ^ work/8080/_0002ftest_0002ejsptest_jsp_0.java:59: Invalid declaration. out.write("rn"); ^