Take a look at the PageService.getLink() method implementation...
You can implement such method in you page class like this:
public abstract PageService getPageService();
public abstract LinkFactory getLinkFactory();
private ILink getCurrentPageLink() {
Map parameters = new HashMap();
// PageService parameters
parameters.put(ServiceConstants.SERVICE,
getPageService().getName());
parameters.put(ServiceConstants.PAGE, this.getPageName());
// Custom parameters
parameters.put("param", "value");
return getLinkFactory().constructLink(getRequestCycle(), false,
parameters, false);
}
Inject PageService & LinkFactory via hivemind.
To get the parameter you may use : getRequestCycle().getParameter("param");
Hope that will help
2005/12/31, Jean-Eric Cuendet <[EMAIL PROTECTED]>:
>
> Thanks, but that's not what I need...
> I need a way to get the URL of the current page in Tapestry.
> And also how to handle arbitrary parameters passed to that page using
> http://server/page.html?&*param*=*Value*
> I need to get param.
> Thanks.
> -jec
>
> Thom Hehl a écrit :
> > Apache has another project in the commons called httpclient that should
> > do the trick. A little tricky to set up the first time, but works pretty
> > well.
> >
> > Jean-Eric Cuendet wrote:
> >
> >> Hi,
> >> I'm implementing a payment solution with Tapestry. I have a page on
> >> which a user can choose some articles and then call a well crafted URL
> >> to make the payment by credit card (www.saferpay.com). I need to give
> >> Saferpay 3 URLs:
> >> - 1 if the transaction is OK
> >> - 1 if the transaction is NOK
> >> - 1 if the user press back or abort.
> >> So I need to get the actual page URL. How? And then, how do I get the
> >> extra parameter I'll add?
> >>
> >> Example: my page is at http://server.com/site/checkout.html
> >> I'll give the OK URL as:
> >> http://server.com/site/checkout.html?payStatus=success&payID=345
> >>
> >> How do I get the payStatus and payID back in my page?
> >> Thanks a lot.
> >> -jec
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > Thom Hehl
> > Heavyweight Software for Heavyweight Needs
> > www.heavyweightsoftware.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>