Thanks, but I am using Velocity, and I am looking for a way to create a
link, not from within the template, but from my Java action class.

I have done some experimenting and doing this:

public String render(String outputType, RunData data)
{
    logger.debug("render: Starting...");
    BaseJetspeedLink jslink = new BaseJetspeedLink(data);
    String href = jslink.toString();
    href += "?eventSubmit_" + this.getId() + "=" + this.getCaption();

    String result = new String();
    if (this.isVisible())
    {
        result += "<a href=\"" + href + "\" class=\"" + this.getStyleClass()
+ "\" ";
        result += "id=\"" + this.getStyleClass() + this.getId() + "\">";
        result += this.getCaption() + "</a>";
    }

    logger.debug("render: Done.");
    return result;
}

seems to work. I am still working on it though...

-Stijn


----- Original Message ----- 
From: "Stefan Rennick Egglestone" <[EMAIL PROTECTED]>
To: "Jetspeed Users List" <[EMAIL PROTECTED]>
Sent: Friday, June 25, 2004 3:27 PM
Subject: Re: $jslink, what is the java equivalent?


> The way I've done this, which I'm sure is not a good way to do it at all
> is as follows. In your jsp, call
>
> Portlet thisPortlet = (Portlet)request.getAttribute("portlet");
> String pageID = portlet.getPortletConfig().getPageID()
>
> The pageID is then a string which looks somehting like
> user/test/html/default.psml
>
> You can then create a link to this page suing this information, to look
> something like
>
> portal/media-type/html/user/test/page/default.psml/
>
> Stijn de Witt wrote:
>
> >You can get the current location from your Velocity template using
$jslink
> >right? My question is, how do I do the equivalent, getting the URL to the
> >current page, from Java?
> >
> >TIA,
> >-Stijn
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
> This message has been scanned but we cannot guarantee that it and any
> attachments are free from viruses or other damaging content: you are
> advised to perform your own checks.  Email communications with the
> University of Nottingham may be monitored as permitted by UK legislation.
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to