この会話は、活動がないためロックされています。新しい投稿を作成してください。
この会話は、活動がないためロックされています。新しい投稿を作成してください。
I have a servlet on my page template at sitemap.xml.jsp that I'm using to generate a sitemap dynamically. I'm running into an issue with the display of the urls.
The output currently displays like:
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>http://dispatcher.localhost:8080/content/online/</loc> <lastmod>2017-03-15</lastmod> <priority>1</priority> </url> <url> <loc> http://dispatcher.localhost:8080/content/online/academics </loc> <lastmod>2017-02-23</lastmod> <priority>0.667</priority> </url> <url> <loc> http://dispatcher.localhost:8080/content/online/apply-today </loc> <lastmod>2017-02-24</lastmod> <priority>0.667</priority> </url> <url> <loc> http://dispatcher.localhost:8080/content/online/cincinnati-online-experience </loc> <lastmod>2017-01-02</lastmod> <priority>0.667</priority> </url> ...
As you can see in the <loc> element, instead of the domain (in this case http://online.uc.edu) it's showing a dispatcher url along with the /content/online
A correct URL would be http://online.uc.edu/cincinnati-online-experience
I'm using externalizer.absoluteLink(), but that doesn't seem to be working in this case. Heres the relevent parts of my jsp file:
public Element getPageNode(Page page, Document doc, Externalizer externalizer, ResourceResolver resourceResolver, SlingHttpServletRequest request,int ogDepth) { //Create a result element Element url = doc.createElement( "url" ); Element loc = doc.createElement( "loc" ); loc.appendChild( doc.createTextNode( externalizer.absoluteLink(request, request.getScheme(), page.getPath()))); url.appendChild( loc ); return url; }
Do I need to change a setting in the externalizer config to make the absolute link work?
解決済! 解決策の投稿を見る。
表示
返信
いいね!の合計
Hi, Ben.
Yes, there is a specific setting for Externalizer: http://<host>:<port>/system/console/configMgr/com.day.cq.commons.impl.ExternalizerImpl
You can configure a "domain" and use its name as the second parameter of externalLink call.
For further info, please check: https://docs.adobe.com/docs/en/aem/6-2/develop/platform/externalizer.html
Be aware that some Sling Mappings may also influence the links generated by the Externalizer.
Regards,
Daniel.
表示
返信
いいね!の合計
Hi, Ben.
Yes, there is a specific setting for Externalizer: http://<host>:<port>/system/console/configMgr/com.day.cq.commons.impl.ExternalizerImpl
You can configure a "domain" and use its name as the second parameter of externalLink call.
For further info, please check: https://docs.adobe.com/docs/en/aem/6-2/develop/platform/externalizer.html
Be aware that some Sling Mappings may also influence the links generated by the Externalizer.
Regards,
Daniel.
表示
返信
いいね!の合計
Be aware that some Sling Mappings may also influence the links generated by the Externalizer.
How it will influence?
In externalizer in set the domain name as www.abc.com.
In etc.dev.publish, i have sling mappings with 2 domains: 1. www.xyz.com and www.abc.com
When sitemap is generating, it is generating the urls with www.xyz.com/home. How can i avoid it?
表示
返信
いいね!の合計
Try externalizer.externalLink(..). Make sure you have configuration for Externalizer domain
表示
返信
いいね!の合計
Or you can simply use Sling Mappings (reverse mapping) and ResourceResolver.map to achieve the same result.
Regards,
Daniel.
表示
返信
いいね!の合計