Passing parameters between CQ pages | Community
Skip to main content
Level 2
October 16, 2015
Solved

Passing parameters between CQ pages

  • October 16, 2015
  • 3 replies
  • 2547 views

Hi,

I have created 2 pages in CQ using different templates. I have a link in first page on click of which I will land on second Page (using <a href> in first page).

Now I want to pass some parameters (either in map or list) from first page to second page.

Kindly let me know what is the best way to pass information between pages (through request , session or cookies?).

Thanks in Advance.

 

Regards,

Sagar

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 Ove_Lindström

It depends...

If you just need to pass a selection, like "show med the cities in the country I selected" - use request parameter or Sling Suffix. This is always the default choice imho.

If it is some sort of wizard, like a registration, then use the session or a cookie. That is if you need to be able to resume the flow or go back and forth. Otherwise, use request parameters.

/Ove

3 replies

Ove_LindströmAccepted solution
Level 6
October 16, 2015

It depends...

If you just need to pass a selection, like "show med the cities in the country I selected" - use request parameter or Sling Suffix. This is always the default choice imho.

If it is some sort of wizard, like a registration, then use the session or a cookie. That is if you need to be able to resume the flow or go back and forth. Otherwise, use request parameters.

/Ove

smacdonald2008
Level 10
October 16, 2015

Another way you can achieve is functionality is by assigning a value to a JCR node. That is Page 1 assigns the value foo to node1. Then page 2 can read the value of node1 to get back foo. 

SagarrAuthor
Level 2
October 16, 2015

Ove & smacdonald2008 , Thanks for you replies.

I have many pages which have same link and on click this link I will land second page which shows some information passed by the previous page.

For Ex: Title and Description of one component which is present in the first page. I am trying to pass them using the request Object but they are not appearing on second page.

If I set those properties to Second Page node when I click the link on First Page will it create any problem if number of users accessing the page are huge at the same time.

should sticky session be enabled if I pass the objects between pages using request / session?

 

Thanks & Regards,

Sagar