Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Passing parameters between CQ pages

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Level 6

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

View solution in original post

3 Replies

Avatar

Correct answer by
Level 6

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

Avatar

Level 10

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. 

Avatar

Level 2

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