一只小白.项目导入后问题

a23520105 2015-08-30 11:15:57
FreeMarker template error:
For "." left-hand operand: Expected a hash, but this evaluated to a directive (wrapper: com.shop.template.directive.SeoDirective):
==> seo [in template "shop/index.ftl" at line 6, column 21]

The failing instruction (FTL stack trace):
----------
==> #if seo.title?? [in template "shop/index.ftl" at line 6, column 16]
@seo type="index" [in template "shop/index.ftl" at line 5, column 1]
----------

Java stack trace (for programmers):
----------
freemarker.core.UnexpectedTypeException: [... Exception message was already printed; see it above ...]
at freemarker.core.Dot._eval(Dot.java:81)
at freemarker.core.Expression.eval(Expression.java:111)
at freemarker.core.ExistsExpression._eval(ExistsExpression.java:81)
at freemarker.core.Expression.eval(Expression.java:111)
at freemarker.core.Expression.evalToBoolean(Expression.java:143)
at freemarker.core.IfBlock.accept(IfBlock.java:82)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Environment$1.render(Environment.java:313)
at com.shop.template.directive.BaseDirective.setLocalVariable(BaseDirective.java:179)
at com.shop.template.directive.SeoDirective.execute(SeoDirective.java:50)
at freemarker.core.Environment.visit(Environment.java:341)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:136)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.MixedContent.accept(MixedContent.java:93)
at freemarker.core.Environment.visit(Environment.java:265)
at freemarker.core.Environment.process(Environment.java:243)
at freemarker.template.Template.process(Template.java:277)
at com.shop.service.impl.StaticServiceImpl.build(StaticServiceImpl.java:86)
at com.shop.service.impl.StaticServiceImpl.build(StaticServiceImpl.java:101)
at com.shop.service.impl.StaticServiceImpl.buildIndex(StaticServiceImpl.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy81.buildIndex(Unknown Source)
at com.shop.listener.InitListener.onApplicationEvent(InitListener.java:42)
at com.shop.listener.InitListener.onApplicationEvent(InitListener.java:1)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1079)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1002)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:506)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2015-8-30 22:45:37 org.apache.catalina.core.ApplicationContext log
信息: [CompressingFilter/1.7] CompressingFilter has initialized
2015-8-30 22:45:37 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'springmvc'
2015-8-30 22:45:39 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2015-8-30 22:45:39 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2015-8-30 22:45:39 org.apache.catalina.startup.Catalina start
信息: Server startup in 12312 ms

...全文
745 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
_低调_ 2017-04-10
  • 打赏
  • 举报
回复
没有效果
_低调_ 2017-04-07
  • 打赏
  • 举报
回复
你好 不知道问题怎么解决的
Caused by: freemarker.core.NonHashException: For "." left-hand operand: Expected a hash, but this evaluated to a directive (wrapper: net.shopxx.template.directive.SeoDirective):
==> seo [in template "shop/yf/index.ftl" at line 11, column 29]

月明星稀灬 2017-04-07
  • 打赏
  • 举报
回复
if标签用错了 可以这样

<#list lorder as result>
        <#if result.applyStatus==0>
        	待审核
        </#if>
</#list>
  • 打赏
  • 举报
回复
一个类似的错误 你的ftl 文件里面,看看这地方:#if seo.title?? [in template "shop/index.ftl" at line 6, column 16] @seo type="index" [in template "shop/index.ftl" at line 5, column 1]
a23520105 2015-08-30
  • 打赏
  • 举报
回复
<body> <!-- <div id=to-right> <div class="alibefore">售前服务</div> <div> <a target="_blank" href="http://www.taobao.com/webww/ww.php?ver=3&touid=%E4%B8%BD%E5%8D%8E%E5%94%AE%E5%89%8D%E6%9C%8D%E5%8A%A1&siteid=cntaobao&status=1&charset=utf-8" ><img border="0" src="http://amos.alicdn.com/online.aw?v=2&uid=%E4%B8%BD%E5%8D%8E%E5%94%AE%E5%89%8D%E6%9C%8D%E5%8A%A1&site=cntaobao&s=1&charset=utf-8" alt="点击这里给我发消息" /></a> </div> <div class="alibefore">售后服务</div> <div><a target="_blank" href="http://www.taobao.com/webww/ww.php?ver=3&touid=%E4%B8%BD%E5%AE%B6%E5%9C%B0%E6%AF%AF%E5%94%AE%E5%90%8E&siteid=cntaobao&status=1&charset=utf-8" ><img border="0" src="http://amos.alicdn.com/online.aw?v=2&uid=%E4%B8%BD%E5%AE%B6%E5%9C%B0%E6%AF%AF%E5%94%AE%E5%90%8E&site=cntaobao&s=1&charset=utf-8" alt="点击这里给我发消息" /></a></div> </div> --> <script type=text/javascript>$("#to-right").float({position:"rm"});$("#to-left").float({position:"lm"});</script> [#include "/shop/include/header.ftl" /] <div class="container index"> <div class="span18"> [@ad_position id = 3 /] </div> <div class="span6 last"> <div id="newArticle" class="newArticle"> [@article_category_root_list count = 3] <ul class="tab"> [#list articleCategories as articleCategory] <li> <a href="${base}${articleCategory.path}" target="_blank">${articleCategory.name}</a> </li> [/#list] </ul> [#list articleCategories as articleCategory] [@article_list articleCategoryId = articleCategory.id count = 5] <ul class="tabContent"> [#list articles as article] <li> <a href="${base}${article.path}" title="${article.title}" target="_blank">${abbreviate(article.title, 30)}</a> </li> [/#list] </ul> [/@article_list] [/#list] [/@article_category_root_list] </div> [@ad_position id = 4 /] </div> <div class="span18"> <div class="hotProductCategory"> <div class="title"> <a href="${base}/product_category.jhtml">${message("shop.index.allProductCategory")}</a> <strong>${message("shop.index.hotProductCategory")}</strong>CATEGORY </div> <div class="content"> [@product_category_root_list count = 4] <table> [#list productCategories as rootProductCategory] <tr[#if !rootProductCategory_has_next] class="last"[/#if]> <th> <a href="${base}${rootProductCategory.path}">${rootProductCategory.name}</a> </th> <td> [#list rootProductCategory.children as productCategory] <a href="${base}${productCategory.path}">${productCategory.name}</a> [/#list] </td> </tr> [/#list] </table> [/@product_category_root_list] </div> </div> </div> <div class="span6 last"> <div class="hotBrand clearfix"> <div class="title"> <a href="${base}/brand/list/1.jhtml">${message("shop.index.allBrand")}</a> <strong>${message("shop.index.hotBrand")}</strong>BRAND </div> <ul> [@brand_list type = "image" count = 6] [#list brands as brand] <li> <a href="${base}${brand.path}" title="${brand.name}"><img src="${brand.logo}" alt="${brand.name}" /></a> </li> [/#list] [/@brand_list] </ul> </div> </div> <div class="span24"> [@ad_position id = 5 /] </div> <div class="span24"> <div id="hotProduct" class="hotProduct clearfix"> [@product_category_root_list count = 3] <div class="title"> <strong>热销商品</strong> <a href="${base}/product/list.jhtml?tagIds=1" target="_blank"></a> </div> <ul class="tab"> <div style="float:right;margin-right:20px; "><a href="${base}/product/list.jhtml?tagIds=1">more</a></div> </ul> [@product_list productCategoryId = productCategory.id tagIds = 1 count = 10] <div class="tabContent"> <div class="tabContenProductLeft"> [#list products as product] [#if product_index==0] <div> <a href="${base}${product.path}" target="_blank"><img src="[#if product.image??]${product.image}[#else]${setting.defaultThumbnailProductImage}[/#if]" width="440" height="440" alt="${product.name}" title="${product.name}" /></a> </div> <div class="tabContenProductLeftName"> <p>${abbreviate(product.name,20)}</p> <p><span>零售价:${currency(product.marketPrice, true)}</span><span class="sy_member">会员价${currency(product.price, true)}</span></p> </div><!--tabContenProductLeftName--> [/#if] [/#list] </div><!--tabContenProductLeft浮动左边--> <div class="tabContenProductRight"> <ul class="tabContenProductRight_ul"> [#list products as product] [#if product_index>0] <li><a href="${base}${product.path}" target="_blank"><img src="[#if product.image??]${product.image}[#else]${setting.defaultThumbnailProductImage}[/#if]" width="155" height="155" alt="${product.name}" title="${product.name}" /></a></li> [/#if] [/#list] </ul> </div><!--tabContenProductRight--> </div><!--tabContent--> [/@product_list] [/@product_category_root_list] </div> </div> <div class="span24"> <div id="newProduct" class="newProduct clearfix"> [@product_category_root_list count = 3] <div class="title"> <strong>${message("shop.index.newProduct")}</strong> <a href="${base}/product/list.jhtml?tagIds=2" target="_blank"></a> </div> <ul class="tab"><div style="float:right;margin-right:20px; "><a href="${base}/product/list.jhtml?tagIds=2">more</a></div> <!-- [#list productCategories as productCategory] <li> <a href="${base}${productCategory.path}?tagIds=2" target="_blank">${productCategory.name}</a> </li> [/#list]--> </ul> <div class="newProductAd"> [@ad_position id = 7 /] </div> [#list productCategories as productCategory] <ul class="tabContent"> [@product_list productCategoryId = productCategory.id tagIds = 2 count = 10] [#list products as product] <li> <a href="${base}${product.path}" title="${product.name}" target="_blank"><img src="${base}/upload/image/blank.gif" data-original="[#if product.image??]${product.image}[#else]${setting.defaultThumbnailProductImage}[/#if]" /></a> </li> [/#list] [/@product_list] </ul> [/#list] [/@product_category_root_list] </div> </div> <div class="span24"> <div class="friendLink"> <dl> <dt>${message("shop.index.friendLink")}</dt> [@friend_link_list count = 10] [#list friendLinks as friendLink] <dd> <a href="${friendLink.url}" target="_blank">${friendLink.name}</a> [#if friendLink_has_next]|[/#if] </dd> [/#list] [/@friend_link_list] <dd class="more"> <a href="${base}/friend_link.jhtml">${message("shop.index.more")}</a> </dd> </dl> </div> </div> </div> [#include "/shop/include/footer.ftl" /] </body> </html>
a23520105 2015-08-30
  • 打赏
  • 举报
回复
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> [@seo type = "index"] <title>[#if seo.title??][@seo.title?interpret /][#else]${message("shop.index.title")}[/#if][#if systemShowPowered] - 地毯销售平台(测试版)[/#if]</title> [#if seo.keywords??] <meta name="keywords" content="[@seo.keywords?interpret /]" /> [/#if] [#if seo.description??] <meta name="description" content="[@seo.description?interpret /]" /> [/#if] [/@seo] <link rel="icon" href="${base}/favicon.ico" type="image/x-icon" /> <link href="${base}/resources/shop/slider/slider.css" rel="stylesheet" type="text/css" /> <link href="${base}/resources/shop/css/common.css" rel="stylesheet" type="text/css" /> <link href="${base}/resources/shop/css/index.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="${base}/resources/shop/js/jquery.js"></script> <script type="text/javascript" src="${base}/resources/shop/js/jquery.tools.js"></script> <script type="text/javascript" src="${base}/resources/shop/js/jquery.lazyload.js"></script> <script type="text/javascript" src="${base}/resources/shop/slider/slider.js"></script> <script type="text/javascript" src="${base}/resources/shop/js/common.js"></script> <script type="text/javascript" src="${base}/resources/shop/js/float.js"></script> <style> #to-right{width:100px; height:60px; margin-top:200px; margin-right:60px;} .alibefore{ line-height:40px; font-family:"微软雅黑";} </style> <script type="text/javascript"> $().ready(function() { var $slider = $("#slider"); var $newArticleTab = $("#newArticle .tab"); var $promotionProductTab = $("#promotionProduct .tab"); var $promotionProductInfo = $("#promotionProduct .info"); var $hotProductTab = $("#hotProduct .tab"); var $newProductTab = $("#newProduct .tab"); var $hotProductImage = $("#hotProduct img"); var $newProductImage = $("#newProduct img"); $slider.nivoSlider({ effect: "random", animSpeed: 1000, pauseTime: 6000, controlNav: true, keyboardNav: false, captionOpacity: 0.4 }); $newArticleTab.tabs("#newArticle .tabContent", { tabs: "li", event: "mouseover", initialIndex: 1 }); $promotionProductTab.tabs("#promotionProduct .tabContent", { tabs: "li", event: "mouseover" }); $hotProductTab.tabs("#hotProduct .tabContent", { tabs: "li", event: "mouseover" }); $newProductTab.tabs("#newProduct .tabContent", { tabs: "li", event: "mouseover" }); function promotionInfo() { $promotionProductInfo.each(function() { var $this = $(this); var beginDate = $this.attr("beginTimeStamp") != null ? new Date(parseFloat($this.attr("beginTimeStamp"))) : null; var endDate = $this.attr("endTimeStamp") != null ? new Date(parseFloat($this.attr("endTimeStamp"))) : null; if (beginDate == null || beginDate <= new Date()) { if (endDate != null && endDate >= new Date()) { var time = (endDate - new Date()) / 1000; $this.html("${message("shop.index.remain")}:<em>" + Math.floor(time / (24 * 3600)) + "<\/em> ${message("shop.index.day")} <em>" + Math.floor((time % (24 * 3600)) / 3600) + "<\/em> ${message("shop.index.hour")} <em>" + Math.floor((time % 3600) / 60) + "<\/em> ${message("shop.index.minute")}"); } else if (endDate != null && endDate < new Date()) { $this.html("${message("shop.index.ended")}"); } else { $this.html("${message("shop.index.going")}"); } } }); } promotionInfo(); setInterval(promotionInfo, 60 * 1000); $hotProductImage.lazyload({ threshold: 100, effect: "fadeIn", skip_invisible: false }); $newProductImage.lazyload({ threshold: 100, effect: "fadeIn", skip_invisible: false }); }); </script> </head>

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧