开发者

struts2 and freemarker template

i use struts2 on my web app, in one jsp file i display 3 arraylist in a form using "iterator".

when i launch my app with tomcat everything works fine. but i would like to make it works with websphere6.1, but when i launch it now the page take 20-30 second to appears, with tomcat it was lass than 1 second.

here is the logs i have on my websphere console :

(freemarker.cache 81 ) Could not find template in cache, creating new one; id=[template/simple/form.ftl[fr_FR,UTF-8,parsed] ]

i have almost 9000 lines of this kind before page a开发者_Go百科ppears.

i tried to create a file "freemarker.properties" with prop :

template_update_delay=60000

also tried to extract the "template/simple" in my source root, on WEB-INF... nothing !

do you have any idea ??


Could not find template in cache

The template folder should copy to WEB_APP root instead of WEB-INF.
My suggestion : Rename the template folder to templates for distinguished from default.

<constant name="struts.ui.templateDir" value="templates" />
<constant name="struts.ui.theme" value="simple" />

Refer to Performance tuning of Struts2 :

  1. Turn off logging and devMode
    Make sure to turn off Freemarker Logging (esp. Freemarker generates a LOT of logging).

  2. Try to use the Freemarker equivalent rather than using the JSP tags
    <s:property value="foo"/> should be replaced by ${foo} (except for type conversion), great performancing enhancing for iterator.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜