Hello,
i have a problem with the slingRequest in the datasource. slingRequest return a OnDemandReaderRequest instead of SlingHttpServletRequest at the creation of the page. how to please get the suffix with a OnDemandReaderRequest? i don't recovers /content/geometrixx/en.
Regards
Views
Replies
Total Likes
Hi Marion,
OnDemandReaderRequest[0] has got method to retrieve PathInfo[1] which in turn has got method to return the suffix[2].
[2] https://sling.apache.org/apidocs/sling5/org/apache/sling/api/request/RequestPathInfo.html#getSuffix()
Can you please add code snippet that does not work?
Regards,
Peter
Views
Replies
Total Likes
At the creation of the page this code (slingRequest.getRequestPathInfo().getSuffix()) return the path of the template (/apps/global/templates/searchpage), and not the suffix /content/geomettrix/en
if(StringUtils.isNotEmpty(slingRequest.getRequestPathInfo().getSuffix())){ path = slingRequest.getRequestPathInfo().getSuffix(); }else{ path = slingRequest.getRequestParameter("item").getString() ; }
Views
Replies
Total Likes
you can change extension in attachment to zip and import in your package. after, you can create a page in /content/geometrixx/en. put a log in datasource and check, the suffix does not return the good suffix..
It is a exemple simple, but it sums up my problem.
Views
Replies
Total Likes
Hi Marion,
Thank you for prompt response and code sample,
When working with dynamic dropdown's have not used the jsp code as find it no as readable as Java code, you are requesting here request that should resolve to the 'geometrixx/components/datasource/datasourceLanguage'.
Why not register a Servlet that would receive your request and produce the results?
This way i would hope you would get whatever comes into Sling Request as a correct Suffix.(given request has correct suffix).
Regards,
Peter
Views
Replies
Total Likes
No, I just do the test .Same with servlet. i have always a org.apache.sling.scripting.core.impl.helper.OnDemandReaderRequest which return a bad suffix :(
Views
Replies
Total Likes