Thank you for confirming that I need to manually set it, I'll stick to the
contextPath property for now and look further at the other resources you've
provided

Thank you for your help
Guillaume

On Thu, Jan 7, 2016 at 10:56 AM, Carsten Ziegeler <[email protected]>
wrote:

> Oliver Lietz wrote
> >
> >>>
> >>> added to the request path (and if yes, how to do so) or if I manually
> >>> have to add ${pageContext.request.contextPath} in my JSPs
> >>
> >> Yes, you need to add the context path for all links going out. You can
> >> either use the way you mention above or use the resourceResolver.map()
> >> functionality.
> >
> > don't do it like above and avoid hardcoding any path which can be changed
> > later. Keep your Sling application portable.
>
> I totally agree that you should not hard code, but neither
> resourceResolver.map() nor using ${pageContext.request.contextPath} in a
> JSP is hard coding. :)
>
> The below mentioned approach of using the rewriter is of course even nicer.
>
> Carsten
>
> >
> > You can use Sling's Rewriter[1] or custom tags or maybe a feature of your
> > template engine or an extension like wcm.io's Link Handler[2] to
> > (post-)process your URLs.
> >
> > Regards,
> > O.
> >
> > [1]
> https://sling.apache.org/documentation/bundles/output-rewriting-pipelines-org-apache-sling-rewriter.html
> > [2] http://wcm.io/handler/link/
> >
> >> Regards
> >> Carsten
> >>
> >>> Thank you very much for your help
> >>>
> >>> Regards,
> >>>
> >>> Guillaume
> >
> >
>
>
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> [email protected]
>

Reply via email to