开发者

Render a requestParameter in Tapestry

I like to render a reqeustParameter "id" in my Tapestry Page.

Something like:

&开发者_JS百科lt;span>${id}</span>

If I request the page with google.com?id=1 it should render <span>1</span> Should be possible, but cant find a solution.

The doc suggest to use @Property in the Java-Class, but I can't import that. --> http://tapestry.formos.com/nightly/tapestry5/guide/parameters.html

thx


Evaluating query parameters is a little bit uncommon in Tapestry, but if you absolutely need them (e.g. some external process calls your page with a parameter), you can access them through the Request service:

@Inject
private Request request;

public String getId() {
    return this.request.getParameter("id");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜