Nil*_*ils 1 java parameters tapestry
我喜欢在我的 Tapestry 页面中呈现一个 reqeustParameter "id"。
就像是:
<span>${id}</span>
Run Code Online (Sandbox Code Playgroud)
如果我请求带有google.com?id=1它的页面应该呈现<span>1</span>应该是可能的,但找不到解决方案。
该文档建议在 Java 类中使用 @Property,但我无法导入它。--> http://tapestry.formos.com/nightly/tapestry5/guide/parameters.html
谢谢
评估查询参数在 Tapestry 中有点不常见,但是如果您绝对需要它们(例如某些外部进程使用参数调用您的页面),您可以通过Request服务访问它们:
@Inject
private Request request;
public String getId() {
return this.request.getParameter("id");
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1416 次 |
| 最近记录: |