Thanks Nick.
I figured it out just a little while ago. For some reason
I had a mental blockage keeping me from making the leap
here. I do this same thing (rendering the URL) for a
Direct Link in a menu component I wrote. I guess I was
hung up on the whole external thing.
Actually one thing I figured out by trial and error was
how to set the page name. I could not find an example on
how to set the page name and the TIA book glosses over
this. I see now its the first parameter.
I do have one more question on this matter though ...
I will be rendering a link to send in an email. When I
tested the link rendering I got a link with a jsessionid
in it.
here is what I got.
/MensanaTestPortal/app;jsessionid=36173DB59075B0E518234D75FFCB8EA4?service=external/ExternalTest&sp=SCody
I don't think that should be in there. How can I avoid
getting that in the URL? This session will be dead by the
time they click on the URL.
Thanks again for the help
Doug
Nick Westgate wrote:
Hi Douglas.
Time to learn some of those Tapestry internals, or rather, APIs. ;-)
Look at the source for some of the link components to see how they do it.
In particular you need to use ILink - see page 333 of TIA, or do search
for it if you have the eBook edition.
Anyway, but here's a quick example.
Create a helper method in your page class.
public String getSomeUrl()
{
// get the external service
IEngineService service = getEngine().getService(
Tapestry.EXTERNAL_SERVICE);
// prepare the parameters
Object[] parameters = new Object[]
{
"PageName",
// other paramaters ...
};
// get the link
ILink link = service.getLink(getRequestCycle(), this, parameters);
return link.getAbsoluteURL();
}
Check out the other methods in ILink to what it can do for you.
Cheers,
Nick.
LOCHART,DOUGLAS E wrote:
External URL Help
I am tasked to allow the following in our secure tapestry app:
1) Generate a URL That a person could mail to a perspective client.
2) That client client would click on the URL to sign up.
3) The URL would activate a Page within our system that would them look at a
parameter in the URL to determine which person's URL was used to activate this
page.
I have been reading chapter 10 in TIA for how to use the External Link's and pages. It
seems fairly straightforward. Where I am getting stumped is that I need to give someone
a URL like "www.signmeup.com/app?Salesman=John Doe" or something of that ilk.
This URL that I give needs to activate an External Page. I guess what I need is to send
an already rendered external link.
How do I do that? I would also need to create the URL's on the fly so that
I could generate one for a new salesman and they could email it to
themselves/write it down or whatever.
I am still quite green. I have a full Tapestry app but I have not used alot
of bells andn whistles yet. What I am saying is don't assume I know a whole
lot of teh Tapestry internals.
Thanks Again in Advance.
Doug
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]