Replacing Request parameters to selectors in URL. | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

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. 

5 replies

smacdonald2008
New Participant
October 16, 2015

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

Ratna_Kumar
New Participant
October 16, 2015

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.

smacdonald2008
smacdonald2008Accepted solution
New Participant
October 16, 2015

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. 

Runal_Trivedi
New Participant
October 16, 2015

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

Ratna_Kumar
New Participant
October 16, 2015

Thanks Runal and Scott..We will work on this and let you know.

Thanks,
Ratna Kumar.