属性还是属性?

发布于 2024-12-23 14:49:00 字数 522 浏览 1 评论 0原文

本书文本的第一张图片

本书文本的第二张图片

在第一张图片的第一段中,有一个属性 currentTip。

在第二张图片中,在第二个标题中,代码是 pageContent.getCurrentTip(),在第三个标题中,代码是 "jsp:getPropery name='pageContent' property ='currentTip'/>"

我的问题是,没有对变量 pageContent 的描述,并且 currentTip 由用于获取某个范围内设置的属性的属性的代码访问。因为在本书前面的例子中,属性是java bean对象,它们的属性是通过getter方法获取的。所以在这里,很明显 currentTip 不是一个属性,而是属性 pageContent 的一个属性。 currentTip 是书中教授的属性还是属性 pageContent 的属性?

1st image of the book's text

2nd Image of the book's text

In the first paragraph in first image, there is an attribute currentTip.

In the second image, in second heading- the code is pageContent.getCurrentTip() and in third heading the code is
"jsp:getPropery name='pageContent' property ='currentTip'/>"

My question is that there is no description of the variable pageContent and currentTip is accessed by the code that is used to get the property of attributes set in some scope. Because in previous examples of the book, the attributes are java bean objects and their properties are got by the getter methods. So here, it is apparent that currentTip is not an attribute but it is a property of the attribute pageContent. Is currentTip an attribute as taught by the book or it is property of attribute pageContent?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一个人练习一个人 2024-12-30 14:49:00

第一段的措辞不正确。请求范围属性是pageContent。由于 JSP 代码使用 ${pageContent.currentTip},这意味着 currentTip 是存储在属性 pageContent 中的 bean 的属性。因此你的理解是正确的,而本书的第一段是错误的。

The wording in the first paragraph is incorrect. The request-scope attribute is pageContent. Since the JSP code uses ${pageContent.currentTip}, this means that currentTip is a property of the bean stored in the attribute pageContent. Your understanding is thus correct, and the first paragraph of the book is wrong.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文