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

how to get the dispatcher url in pages

Avatar

Level 3
Please let me know as how can I get the dispatcher URL in the code and use the same in author and Publish instance.
 
In the Author instance showing the port number in the view source is fine.
 
But in Publish instance it must just display only the dispacther URL should not show the exact URL and port numb er
 

I have a dispatcher url as:-

 
http://www-qa.com/content/campaigns/website/en_US/page.html
 
 
In my code jsp I have added
 
String hostname= "http://"+ slingRequest.getServerName()+":"+slingRequest.getServerPort();
 
so when I add the code for images in the src I am adding SRC as src="<%= hostname %>/etc/designs/dsm/img/bottom-border.gif"  as mentioned below
 
 
<img src="<%= hostname %>/etc/designs/dsm/img/bottom-border.gif" width="640" height="33" />
 
 
 
So this add the actual cq server instead we want just the Dispatcher URL how could I achieve it
1 Accepted Solution

Avatar

Correct answer by
Level 8
3 Replies

Avatar

Correct answer by
Level 8