What you want to do is very similar to a the redirect-after-post form
submission pattern.

The string used with @InjectObject is broken into two parts; the
prefix and the value.

The prefix identifies how the value is parsed and interpreted.

The "service:" prefix is built-in to HiveMind, and references a
HiveMind service by its fully qualified id.

Tapestry adds additional prefixes; there's an "engine-service:" prefix
that references a Tapestry engine service by its service name (i.e.,
"page" or "direct").  This is better and eaiser than figuring out the
corresponding HiveMind service id.

Thus,

@InjectObject("engine-service:page")
public abstract IEngineService getPageService();

If you look at documentation at 
http://tapestry.javaforge.com/tapestry-flash/ , you'll see an example
of how to use this for a redirect-after-post.

In your case, I would suspect that the proper service would be
"external", so that your destination pages can implement the
IExternalPage interface (and the activeExternalPage() method).  Inside
that method, you can get query parameter values from the request cycle
object.

When using the external service, the third parameter is not a string
(the page name), but an instance of ExternalServiceParameter; this
allows the page name and the set of listener parameters to be provided
all in one go.

As I understand your external credit card page, you'll invoke
getLink() three times on the external service, getting back ILink
objects for three different pages (or the same page with three
different sets of listener parameters ... or whatever works for you).

You then invoke getAbsoluteURL() on the ILink to get a URL string.

Happy new year!



On 12/31/05, Jean-Eric Cuendet <[EMAIL PROTECTED]> wrote:
>
> > Take a look at the PageService.getLink() method implementation...
>
> Thanks, that could help. Could you please explain how to Inject this
> Object into my page?
> Something like:
>
>    @InjectObject("service:<what_to_put>")
>    public abstract PageService getPageService();
>
> What should be what_to_put ?
> And need I to define it in *my* hivemodule.xml? Or is it already done by
> Tapestry?
> Thanks.
> -jec
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to