AEM SPA React - Dispatcher Setup

Avatar

Avatar

bipinchandra92

Avatar

bipinchandra92

bipinchandra92

20-10-2020

We have tried to setup the dispatcher for the AEM SPA Journal Project.

In the Apache, we have done the rewrite to short the urls to hide the content hierarchy.

http://localhost/content/we-retail-journal/react/en/home.html to http://localhost/react/en/home.html

 

Only with the /content the react application is working and in the XHR there is only one call for model.json

bipinchandra92_0-1603208827473.png

 

And with the short url we are getting the two model.json calls that are 

bipinchandra92_1-1603208887546.png

 

What steps needed  in the AEM SPA dispatcher setup to hide the /content  hierarchy?

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Nikhil-Kumar

MVP

Avatar

Nikhil-Kumar

MVP

Nikhil-Kumar
MVP

21-10-2020

@bipinchandra92  - Can you verify that, When you are hitting short URL then are you getting :children property in en.model.json ?

This happens when you page data is loaded from home.model.json instead of en.model.json.

So, In first case your data gets fetched from root e.model.json and whereas in second case it gets fetched from home.model.json(respecctive page). 

As per my understanding you :path property in preview mode of en.model.json should match with the request URI. So when you hit short path i.e without /content/project-name it looks for :path property in en.model.json  where it doesn't match and moves to individual page's model.json i.e home.model.json

Answers (1)

Answers (1)

Avatar

Avatar

Shashi_Mulugu

MVP

Avatar

Shashi_Mulugu

MVP

Shashi_Mulugu
MVP

20-10-2020

@bipinchandra92 I think it is nothing to do with dispatcher. Please check your spa logic where it is firing two XHR requests.