incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Janne Jalkanen <janne.jalka...@ecyrd.com>
Subject Re: howto get the jspwiki URL of a page
Date Fri, 12 Sep 2008 13:55:02 GMT

Heya!

Just use

<snip>
WikiEngine wiki = context.getEngine();

// Returns /Wiki.jsp?page=Foobar
String url = wiki.getURL( WikiContext.VIEW, "Foobar", null, false );

// Returns /Edit.jsp?page=Foobar
String url = wiki.getURL( WikiContext.EDIT, "Foobar", null, false );

// Returns http://mywiki.org/Wiki.jsp?page=Foobar
String url = wiki.getURL( WikiContext.VIEW, "Foobar", null, true );
<snip>

Whether you get an absolute or a relative URL in the first two cases  
depends on the setting of jspwiki.referenceStyle in your  
jspwiki.properties.

/Janne

On 12 Sep 2008, at 09:07, Lannaud, Eric wrote:

> Sorry to disturbing you !  I'm  writing a plugin.
>
> When I get :
> WikiEngine wikiengine=context.getEngine();
> How do I do for print:
> /Edit.jsp?page=PageXXXXX
> Or
> /Wiki.jsp?page=PageXXXXX
>
> The best is to print directly the full HTML like:
> <a class="wikipage" href="Wiki.jsp?page=PageXXXXX">PageXXXXX</a>
> Or
> <a class="createpage" href="Edit.jsp?page=PageXXXXX" title="Create  
> 'PageXXXXX'">PageXXXXX</a>
>
> Thank you for your help   --Eric
>
>
>


Mime
View raw message