当前位置: 代码迷 >> Ajax >> 怎么在freemarker中使用ajax theme
  详细解决方案

怎么在freemarker中使用ajax theme

热度:1487   发布时间:2012-10-25 10:58:57.0
如何在freemarker中使用ajax theme
为什么我在.ftl文件中使用<@ww.head theme="ajax" debug="false"/>时就出错呢?请高手帮我看看到底是哪里的问题?
xwork.xml配置:
<action name="modTribeInput"
    class="com.xwkj.blog.tribe.web.action.TribeInputAction" method="modTribeInput">
  <result name="success" type="freemarker">/view/tribe/admin_tribe_1.htm</result>
  <interceptor-ref name="defaultComponentStack"/>
</action>
视图文件admin_tribe_1.htm部分代码:
<#import "/view/util/MarcoUtil.html" as pageUtil>
<html>
<head>
<base href="<@pageUtil.base/>"/>
<@ww.head theme="ajax" debug="false"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css/base.css" type="text/css" rel="stylesheet">
<link href="../css/main.css" type="text/css" rel="stylesheet">
<title>部落编辑</title>
.....

出错信息:
FreeMarker template error!

on line 5, column 1 in view/tribe/admin_tribe_1.htm ww.head not found.
The problematic instruction:
----------
==> user-directive ww.head [on line 5, column 1 in view/tribe/admin_tribe_1.htm]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: on line 5, column 1 in view/tribe/admin_tribe_1.htm ww.head not found.
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:136)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:196)
at freemarker.core.Environment.process(Environment.java:176)
at freemarker.template.Template.process(Template.java:231)
at com.opensymphony.webwork.views.freemarker.FreemarkerResult.doExecute(FreemarkerResult.java:85)
at com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execute(WebWorkResultSupport.java:101)
at com.opensymphony.xwork.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:311)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:206)
at com.opensymphony.xwork.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:168)
at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:115)
at com.opensymphony.xwork.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.webwork.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:136)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:151)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:186)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:188)
at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:113)
at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:172)
at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
at org.common.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:34)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:178)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:268)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:389)
at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:507)
at com.caucho.util.ThreadPool.run(ThreadPool.java:433)
at java.lang.Thread.run(Thread.java:595)




1 楼 luogl 2007-01-30  
帮忙顶一下啊
2 楼 luogl 2007-01-31  
我在webwork的showcase里又按原来思路试了一遍,通过!然后我再按showcase里的配置相应更新原来的应用,不行!copy showcase里的jar包覆盖原来应用的jar包,还是不行!我到底哪里错了?oh my god!
3 楼 luogl 2007-01-31  
终于找到原因了,原来是包冲突!我的工程里有webwork-2.2.4.jar和webwork-2-beta.2.4.jar,删除webwork-2-beta.2.4.jar就没错了,但是,新的问题又出来了我用:
<@ww.tabbedPanel id="tabbedpanel" >
<@ww.panel id="panel1" tabName="Panel1" remote="true" href="" theme="ajax" />
<@ww.panel id="panel2" tabName="Panel2" remote="true" href="" theme="ajax"  />
<@ww.panel id="panel3" tabName="Panel3" remote="true" href="" theme="ajax" />
</@ww.tabbedPanel>

显示不出那种标签的效果!为什么呢?