[opencms-dev] Re: Link resolving with OpenCms API
Uhlig, Roman
roman.uhlig at knve.de
Fri Dec 16 17:42:38 CET 2005
I see. I was just hoping the link resolving would work for OpenCms API
methods like getNavigationForFolder() as well, cause working with
"/sites/default" in the site dropdown is quite circumstantial when
developing a module along with site itself.
Thank you for your fast reply :)
Roman
-------------------------------------------------------------
Hello,
The method you are talking about doesn't require the
/opencms/opencms/ prefix.
This works with the VFS paths not the real path.
You should use only getNavigationForFolder("/mysite/eng/index.html");
Even if in Offline project you should always work and preview your
pages in "/sites/default/" selected
in the top dropdown not "/".
Best regards,
Andras.
Uhlig, Roman wrote:
>Hi,
>
>I'd like to resolve a link with the CmsJspActionElement.link(String)
>method with a scriptlet within a JSP page like that:
>
>CmsJspActionElement cms = new CmsJspActionElement(pageContext, request,
>response);
>java.util.List nav_element_list =
>cms.getNavigation().getNavigationForFolder(cms.link("/sites/default/mys
i
>te/eng/index.html"));
>
>Unfortunately the cms.link() method returns
>"/opencms/opencms/sites/default/mysite/eng/index.html" instead of
>"/sites/default/mysite/eng/index.html", which causes the
>getNavigationForFolder() method to fail. If I hardcode the path,
>everythings works fine, but I have of course no link resolving in the
>online project.
>
>Any ideas someone?
>
>Thank you in advance,
>Roman Uhlig
>
>
>_______________________________________________
>This mail is send to you from the opencms-dev mailing list
>To change your list options, or to unsubscribe from the list, please
visit
>http://mail.opencms.org/mailman/listinfo/opencms-dev
>
>
>
More information about the opencms-dev
mailing list