a540268158 2015-07-21 01:41 采纳率: 0%
浏览 1700

求帮助playframework一个小问题

我在用play1.27做一个练习时遇到些问题图片说明

这个是controller下的index方法中代码,查询数据
图片说明

图片说明
这两个是实体类User用户和Post文章
图片说明
用了test测试代码没问题,图片说明

以下是页面代码
#{extends 'main.html' /}
#{set title:'Home' /}

#{if frontPost}



${frontPost.title}



by ${frontPost.author.fullname}
${frontPost.postedAt.format('MMM dd')}

 | 
${frontPost.comments.size() ?: 'no'}
comment${frontPost.comments.size().pluralize()}
#{if frontPost.comments}
, latest by ${frontPost.comments[-1].author}
#{/if}



${frontPost.content.nl2br()}

#{if olderPosts}
    <div class="older-posts">    
        <h3>Older posts <span class="from">from this blog</span></h3>

        #{list items:olderPosts, as:'oldPost'}
            <div class="post">
                <h2 class="post-title">
                    <a href="#">${oldPost.title}</a>
                </h2>
                <div class="post-metadata">
                    <span class="post-author">
                        by ${oldPost.author.fullname}
                    </span>
                    <span class="post-date">
                        ${oldPost.postedAt.format('dd MMM yy')}
                    </span>
                    <div class="post-comments">
                        ${oldPost.comments.size() ?: 'no'} 
                        comment${oldPost.comments.size().pluralize()}
                        #{if oldPost.comments}
                            - latest by ${oldPost.comments[-1].author}
                        #{/if}
                    </div>
                </div>
            </div>
        #{/list}
    </div>

#{/if}

#{/if}

#{else}


There is currently nothing to read here.

#{/else}
问下各位哪里错误了
  • 写回答

1条回答 默认 最新

  • a540268158 2015-07-21 01:49
    关注

    图片说明这个是报错信息

    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序