2007年3月23日 星期五

Enhance performance on Tomahawk with facelets

Reference Performance

最近注意到JSF的SESSION吃滿重的,雖然說可以設定其他的scope,

但有許多行為必須靠session來達成,只好試著把session的負擔減輕,

不過至少不會比Wicket肥==+
1.Add there tag in tomahawk.taglib.xml.
tag>
tag-name>document /tag-name>
component>
component-type>org.apache.myfaces.Document /component-type>
/component>
/tag>

tag>
tag-name>documentHead /tag-name>
component>
component-type>org.apache.myfaces.DocumentHead /component-type>
/component>
/tag>

tag>
tag-name>documentBody /tag-name>
component>
component-type>org.apache.myfaces.DocumentBody /component-type>
/component>
/tag>

2.Add this in web.xml.
context-param>
param-name>javax.faces.STATE_SAVING_METHOD /param-name>
param-value>server /param-value>
/context-param>

context-param>
param-name>org.apache.myfaces.ADD_RESOURCE_CLASS /param-name>
param-value>org.apache.myfaces.component.html.util.StreamingAddResource /param-value>
/context-param>

context-param>
param-name>org.apache.myfaces.COMPRESS_STATE_IN_SESSION /param-name>
param-value>false /param-value>
/context-param>

context-param>
param-name>org.apache.myfaces.SERIALIZE_STATE_IN_SESSION /param-name>
param-value>false /param-value>
/context-param>

context-param>
param-name>org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION /param-name>
param-value>20 /param-value>
/context-param>

3.Change html,head and body on web page.
t:document -> html
t:documentHead -> head
t:documentBody -> body

沒有留言: