On Monday 02 May 2016 17:00:00 Guillaume Lucazeau wrote: > Hello, Hi Guillaume, > I thought I could use different views. For instance for a page resource, I > could have presentation.html.jsp, read-only.html.jsp and html.jsp. To use > the presentation view it's all good I cn hard code it in my link has it's > the user that will manually request this view. However, for the read-only > view, it depends on the document status. If it's locked or if the user has > no write privileges, this view should be rendered. > > I was thinking to implement a filter that would check these two conditions, > and dynamically add the "read-only" selector to the request if the user is > not allowed to edit the resource. > > However, I did not find a way to add a selector to a request using the > Sling API, is it possible somehow to update RequestPathInfo? Like the > "replaceSelectors" parameter of the sling:include tag but in Java code. is > that possible?
sure, see FormServlet in samples/fling. It adds a selector on success and forwards the request. Regards, O. > Thank you for your help! > > Kind regards, > Guillaume [...]
