2016-07-24 49 views
2

我想知道AEM中具有不同內容結構的多租戶應用程序的錯誤處理。我的應用程序步驟如下:aem中的應用程序的錯誤處理

/content/firstapp/en 

---- Difficulty in the multicountry and multitenancy 
/content/secondapp/country-1/en 
/content/secondapp/country-2/en 
/content/secondapp/country-3/en 

/contente/thirdapp/en 

Please suggest in this case someone implemented this kind of structure in the past or have more information to do this approachae,. thanks, Sandeep 

回答

0

第一步是要有正確的設置錯誤處理程序,在那裏你是在響應狀態設置正確的錯誤代碼。

樣品用於錯誤處理程序404配置404.jsp

<% 
if (com.day.cq.wcm.api.WCMMode.fromRequest(request) != com.day.cq.wcm.api.WCMMode.DISABLED) { 
%> 
    <%@include file="/libs/sling/servlet/errorhandler/404.jsp"%> 
<% 
} else { 
    response.setStatus(404); 
} 
%> 

下一步是具有阿帕奇/調度程序配置成加載(在虛擬主機config配置)正確的錯誤的文件。這樣的錯誤頁面的正確裝載委託給了Apache /調度 -

<LocationMatch "^/content/secondapp/country-1/en/.*$"> 
    ErrorDocument 404 "/country-1/not-found.html" 
    ErrorDocument 500 "/country-1/error.html" 
</LocationMatch> 

<LocationMatch "^/content/secondapp/country-2/en/.*$"> 
    ErrorDocument 404 "/country-2/not-found.html" 
    ErrorDocument 500 "/country-2/error.html" 
</LocationMatch> 

<LocationMatch "^/content/secondapp/country-3/en/.*$"> 
    ErrorDocument 404 "/country-3/not-found.html" 
    ErrorDocument 500 "/country-3/error.html" 
</LocationMatch> 

<LocationMatch "^/content/secondapp/country-4/en/.*$"> 
    ErrorDocument 404 "/country-4/not-found.html" 
    ErrorDocument 500 "/country-4/error.html" 
</LocationMatch> 

上述的結構的基礎上,短網址,其中在圖案 /content/secondapp/country-x/en/.*縮短to /country-4/en/.*和每個網站都有自己的頁面的error.html和not-found.html

相關問題