WebWork学习小记

阅读更多
1、集成各种view
推荐直接使用 result type 集成
2、在集成freemarker时候需要注意:
  1) <#assign ww=JspTaglibs["/WEB-INF/lib/webwork.tld"] />已不用因为 webwork2.2的freemarker的tag支持是内置的,
  2)${wwUtil}已换成${webwork}
3、使用sitemesh时,一般推荐使用其PageFilter得扩展。
  1)Velocity:VelocityPageFilter
  2)Freemarker:
FreeMarkerPageFilter
  3) ActionContextCleanUp的作用是告诉会通知FilterDispatcher在正确的时间清除请求.否则,ActionContext将在SiteMesh修饰器访问数据之前被清除.
  ∴ 使用的时候web.xml加声明(顺序很重要)
< filter >
< filter-name > webwork-cleanup filter-name >
< filter-class >
   com.opensymphony.webwork.dispatcher.ActionContextCleanUp
filter-class >
filter>
<filter>
<filter-name>sitemeshfilter-name>

<filter-class>com.opensymphony.webwork.sitemesh.XXXPageFilterfilter-class>
filter>
<filter>
<filter-name>webworkfilter-name>
<filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcherfilter-class>
filter>

<filter-mapping>
<filter-name>webwork-cleanupfilter-name>
<url-pattern>/*url-pattern>
filter-mapping>
<filter-mapping>
<filter-name>sitemeshfilter-name>
<url-pattern>/*url-pattern>
filter-mapping>
<filter-mapping>
<filter-name>webworkfilter-name>
<url-pattern>/*url-pattern>
filter-mapping>



Vencent Chen 2006-06-04 17:02 发表评论

你可能感兴趣的:(Webwork,freemarker,velocity,Web,XML)