Tapestry 4.1 中@If 和 someText@If jwcid 的区别
Difference between @If and someText@If jwcid in Tapestry 4.1
考虑到 Tapestry 4.1 自 2007 年或 08 年以来就没有更新过,这可能是一个远景。但在工作中,他们有一个使用 Tapestry 4.1 的旧遗留应用程序。
我在想,这两者有什么区别
<span jwcid="something@If" condition="ognl:something">
和
<span jwcid="@If" condition="ognl:something">
如果有的话?或者 @If
之前的 something
除了使它成为一个唯一的 id 之外没有其他目的,也许可以在其他地方引用?
这是我能够找到的一些关于 Tapestry 4.1 的文档,但我无法找到我的问题的答案:
- http://tapestry.apache.org/tapestry4.1/
- http://dev.bjmaxinfo.com/docs/tapestry/4.0.2/tapestry/apidocs/index.html
- https://wiki.apache.org/tapestry/
编辑:好的,我找到了部分答案 in the documentation 我已经在上面链接了。
Understanding DirectLink URLs
The URLs generated by the DirectLink component are more complex than those generated by the PageLink component. Let's look at one:
http://localhost:8080/directlink/app?component=%24DirectLink&page=Home&service=direct&session=T
The first query parameter, component, identifies the component within the page. That %24 is "URL-ese" for a dollar sign. In Tapestry, every component ends up with a unique id within its page. If you don't provide one, Tapestry creates one from the component type, prefixed with a dollar sign. Here, our annoynmous DirectLink component was given the id $DirectLink. If you had many different DirectLinks on a page, you'd start seeing component ids such as $DirectLink_0, $DirectLink_1, etc.
You can give a component a shorter and more mneumonic id by putting the desired id before the "@" sign:
<a href="#" jwcid="inc@DirectLink" listener="listener:doClick">increment counter</a>
After making that change to the template, the URL for the DirectLink component is just a bit easier to read:
http://localhost:8080/directlink/app?component=inc&page=Home&service=direct&session=T
但这如何适用于不显示在 URL 中的 @If?
如您所说,这只是 Tapestry 在其组件模型中使用的标识符。
以下是用户指南中的相关文档:Component IDs
考虑到 Tapestry 4.1 自 2007 年或 08 年以来就没有更新过,这可能是一个远景。但在工作中,他们有一个使用 Tapestry 4.1 的旧遗留应用程序。
我在想,这两者有什么区别
<span jwcid="something@If" condition="ognl:something">
和
<span jwcid="@If" condition="ognl:something">
如果有的话?或者 @If
之前的 something
除了使它成为一个唯一的 id 之外没有其他目的,也许可以在其他地方引用?
这是我能够找到的一些关于 Tapestry 4.1 的文档,但我无法找到我的问题的答案:
- http://tapestry.apache.org/tapestry4.1/
- http://dev.bjmaxinfo.com/docs/tapestry/4.0.2/tapestry/apidocs/index.html
- https://wiki.apache.org/tapestry/
编辑:好的,我找到了部分答案 in the documentation 我已经在上面链接了。
Understanding DirectLink URLs
The URLs generated by the DirectLink component are more complex than those generated by the PageLink component. Let's look at one:
http://localhost:8080/directlink/app?component=%24DirectLink&page=Home&service=direct&session=T
The first query parameter, component, identifies the component within the page. That %24 is "URL-ese" for a dollar sign. In Tapestry, every component ends up with a unique id within its page. If you don't provide one, Tapestry creates one from the component type, prefixed with a dollar sign. Here, our annoynmous DirectLink component was given the id $DirectLink. If you had many different DirectLinks on a page, you'd start seeing component ids such as $DirectLink_0, $DirectLink_1, etc.
You can give a component a shorter and more mneumonic id by putting the desired id before the "@" sign:
<a href="#" jwcid="inc@DirectLink" listener="listener:doClick">increment counter</a>
After making that change to the template, the URL for the DirectLink component is just a bit easier to read:
http://localhost:8080/directlink/app?component=inc&page=Home&service=direct&session=T
但这如何适用于不显示在 URL 中的 @If?
如您所说,这只是 Tapestry 在其组件模型中使用的标识符。
以下是用户指南中的相关文档:Component IDs