标签没有收到模型bean(它为null),但是包含页面呢? [英] tag not receiving the model bean (it's null) but containing page does?

查看:88
本文介绍了标签没有收到模型bean(它为null),但是包含页面呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在从接缝应用程序几页的端口中测试Playframework.我们有一页,在两种形式之间重用了很多html,其中一种形式增加了3个字段.移植后,我们发现了

We are testing out playframework from a port of a few pages of our seam application. We have one page where alot of the html is reused between two forms where one form adds 3 more fields. After porting this, we discovered that

电子邮件为$ {user.email}

The email is ${user.email}

可在包含页面中运行,但在标记页面中,playframework表示用户为空?到底是怎么回事?这是错误还是故意的?如果我无法访问动态数据,标记文件就没用吗?所以我相信一定是我,但是我剪切并粘贴了同一行.有任何想法吗?任何人都有这样一个简单的案例行得通吗?

works in the containing page but in the tag page, playframework says user is null???? What is going on? Is this a bug or is this intended? Aren't tag files useless if I can't access dynamic data? so I believe it has to be me, but I cut and paste the same line. Any ideas? Anyone have a simple case like this that works?

推荐答案

标记是自包含的,并不假定存在数据或项目.这是因为标签可以在许多页面之间重复使用.因此,您必须将所有数据项作为参数传递到标签中.

Tags are self contained, and do not assume that data or items exist. This is because a tag can be re-used between many pages. Therefore, you have to pass any data items into the tags as parameters.

这篇关于标签没有收到模型bean(它为null),但是包含页面呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆