注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

和申的个人主页

专注于java开发,1985wanggang

 
 
 

日志

 
 

if-else [on line 6, column 3 Expression channel is undefined on line 6, column 8 in WEB-INF/t/cms/www/red/content/inc_comment_input.html jeecms,bug 2.0.3 final  

2011-02-20 22:46:13|  分类: cms |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
2011-2-20 22:07:07 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet JeeCmsFront threw exception

Expression channel is undefined on line 6, column 8 in WEB-INF/t/cms/www/red/content/inc_comment_input.html.
The problematic instruction:
----------
==> if-else  [on line 6, column 3 in WEB-INF/t/cms/www/red/content/inc_comment_input.html]
 in include "../content/inc_comment_input.html" [on line 62, column 11 in WEB-INF/t/cms/www/red/special/评论页.html]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression channel is undefined on line 6, column 8 in WEB-INF/t/cms/www/red/content/inc_comment_input.html.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:111)
at freemarker.core.OrExpression.isTrue(OrExpression.java:68)
at freemarker.core.IfBlock.accept(IfBlock.java:80)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.include(Environment.java:1483)
at freemarker.core.Include.accept(Include.java:169)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:210)
at freemarker.core.Environment.process(Environment.java:190)
at freemarker.template.Template.process(Template.java:237)
at com.jeecms.common.web.springmvc.SimpleFreeMarkerView.renderMergedTemplateModel(SimpleFreeMarkerView.java:114)
at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.jeecms.common.web.ProcessTimeFilter.doFilter(ProcessTimeFilter.java:38)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)
22:07:08.119 ERROR freemarker.runtime - Expression channel is undefined on line 6, column 8 in WEB-INF/t/cms/www/red/content/inc_comment_input.html.
freemarker.core.InvalidReferenceException: Expression channel is undefined on line 6, column 8 in WEB-INF/t/cms/www/red/content/inc_comment_input.html.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) ~[freemarker-2.3.16.jar:2.3.16]
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134) ~[freemarker-2.3.16.jar:2.3.16]
at freemarker.core.Dot._getAsTemplateModel(Dot.java:78) ~[freemarker-2.3.16.jar:2.3.16]
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89) ~[freemarker-2.3.16.jar:2.3.16]
at freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:111) ~[freemarker-2.3.16.jar:2.3.16]
at freemarker.core.OrExpression.isTrue(OrExpression.java:68) ~[freemarker-2.3.16.jar:2.3.16]
at freemarker.core.IfBlock.accept(IfBlock.java:80) ~[freemarker-2.3.16.jar:2.3.16]
at freemarker.core.Environment.visit(Environment.java:210) [freemarker-2.3.16.jar:2.3.16]
at freemarker.core.MixedContent.accept(MixedContent.java:92) [freemarker-2.3.16.jar:2.3.16]
at freemarker.core.Environment.visit(Environment.java:210) [freemarker-2.3.16.jar:2.3.16]
at freemarker.core.Environment.include(Environment.java:1483) [freemarker-2.3.16.jar:2.3.16]
at freemarker.core.Include.accept(Include.java:169) [freemarker-2.3.16.jar:2.3.16]
at freemarker.core.Environment.visit(Environment.java:210) [freemarker-2.3.16.jar:2.3.16]
at freemarker.core.MixedContent.accept(MixedContent.java:92) [freemarker-2.3.16.jar:2.3.16]
at freemarker.core.Environment.visit(Environment.java:210) [freemarker-2.3.16.jar:2.3.16]
at freemarker.core.Environment.process(Environment.java:190) [freemarker-2.3.16.jar:2.3.16]
at freemarker.template.Template.process(Template.java:237) [freemarker-2.3.16.jar:2.3.16]
at com.jeecms.common.web.springmvc.SimpleFreeMarkerView.renderMergedTemplateModel(SimpleFreeMarkerView.java:114) [jeecms-common-3.0.2-final.jar:na]
at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549) [spring.web.servlet-3.0.5.jar:3.0.5.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) [servlet-api.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:6.0.29]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.29]
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) [spring.orm-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring.web-3.0.5.jar:3.0.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.29]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.29]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [spring.web-3.0.5.jar:3.0.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring.web-3.0.5.jar:3.0.5.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.29]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.29]
at com.jeecms.common.web.ProcessTimeFilter.doFilter(ProcessTimeFilter.java:38) [jeecms-common-3.0.2-final.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:6.0.29]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:6.0.29]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:6.0.29]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:6.0.29]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:6.0.29]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina.jar:6.0.29]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:6.0.29]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) [catalina.jar:6.0.29]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) [tomcat-coyote.jar:6.0.29]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) [tomcat-coyote.jar:6.0.29]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) [tomcat-coyote.jar:6.0.29]
at java.lang.Thread.run(Thread.java:662) [na:1.6.0_22]

原因 :
inc_comment_input.html文件中
<div class="comment">
  <h2><span>网友评论</span> 已有 <em>${content.comments}</em> 条评论,<a href="${base}/comment.jspx?contentId=${content.id}" target="_blank">查看更多评论&raquo;</a></h2>
  <div class="w98">
  [#include "inc_comment_list.html"/] 
  </div>
  [#if channel.commentControl==0 || (channel.commentControl==1 && user??)]
channel 没有定义,没有在model中,
修正:
更改 com.jeecms.cms.action.front.CommentAct类中
@RequestMapping(value = "/comment*.jspx", method = RequestMethod.GET)
public String page(Integer contentId, Integer pageNo,
HttpServletRequest request, HttpServletResponse response,
ModelMap model) {
CmsSite site = CmsUtils.getSite(request);
Content content = contentMng.findById(contentId);
if (content == null) {
return FrontUtils.showMessage(request, model,
"comment.contentNotFound");
}
if (content.getChannel().getCommentControl() == ChannelExt.COMMENT_OFF) {
return FrontUtils.showMessage(request, model, "comment.closed");
}
// 将request中所有参数保存至model中。
model.putAll(RequestUtils.getQueryParams(request));
FrontUtils.frontData(request, model, site);
FrontUtils.frontPageData(request, model);
model.addAttribute("content", content);
//需要增加的部分
Channel channel = content.getChannel();
model.addAttribute("channel", channel);
return FrontUtils.getTplPath(request, site.getSolutionPath(),
TPLDIR_SPECIAL, COMMENT_PAGE);
}
  评论这张
 
阅读(4983)| 评论(1)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2016