Hi,
Can anyone tell me how to convert request parameters and values to selectors in URL.
Example query parameter URL: http://IP:4503/content/en/mobilecontent/services.catalogContent.json?gameIds=2020-2020,2121-2121.
Thanks,
Venkata.
Solved! Go to Solution.
Views
Replies
Total Likes
Here is a really detailed community article by one of our partners in AEM:
http://www.citytechinc.com/us/en/blog/2013/08/apache-sling-selectors-request-parameters.html
I have never seen passing parameters without using ? in a Sling URL.
Views
Replies
Total Likes
Hi
A selector and parameters both make up a request. See the Sling cheat sheet:
http://docs.adobe.com/docs/en/cq/5-6-1/developing/sling_cheatsheet.html
Views
Replies
Total Likes
Hi Scott,
We want to remove the question mark with request parameters for Apache caching.
So, Is there any way to send the parameters and values through URL without "?".
Thanks in Advance,
Ratna Kumar.
Views
Replies
Total Likes
Here is a really detailed community article by one of our partners in AEM:
http://www.citytechinc.com/us/en/blog/2013/08/apache-sling-selectors-request-parameters.html
I have never seen passing parameters without using ? in a Sling URL.
Views
Replies
Total Likes
Ratna Kumar wrote...
Hi Scott,
We want to remove the question mark with request parameters for Apache caching.
So, Is there any way to send the parameters and values through URL without "?".
Thanks in Advance,
Ratna Kumar.
If your only concern is to cache the page when it contains query params then you can configure this in dispatcher itself under /ignoreUrlParams
, here you need to configure all valid params under /ignoreUrlParams for which page should be cached.
You can know more /ignoreUrlParams on https://docs.adobe.com/docs/en/dispatcher/disp-config.html
E.g. /ignoreUrlParams is configured under /cache, something like below:
/cache
{
/ignoreUrlParams
{
/0001 { /glob "*" /type "deny" }
/0003 { /glob "cq_ck" /type "allow" }
/0004 { /glob "wcmmode" /type "allow" }
}
}
Above will cache the page and return the cached page even when query param present is one of cq_ck or wcmmode.
Once you have done it, make sure you have your JS read the parameter for you and refresh the content accordingly on the page, if you don't do this then it will always display static data and your content won't refresh per ID present in attribute.
- Runal
Views
Replies
Total Likes
Thanks Runal and Scott..We will work on this and let you know.
Thanks,
Ratna Kumar.
Views
Replies
Total Likes
Views
Likes
Replies