2016-07-24 5 views
2

Ich wundere mich über die Fehlerbehandlung in AEM für Multi-Tenancy-Anwendungen mit unterschiedlicher Inhaltsstruktur. Meine Anwendungen Schritte sind folgende:Fehlerbehandlung für Anwendungen in 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 

Antwort

0

Erster Schritt ist richtig eingestellt, die Fehlerbehandlung zu haben, wo in Sie richtigen Fehlercode in dem Antwortstatus setzen.

Probe für die Fehlerbehandlungsroutine für 404 Konfigurationen 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); 
} 
%> 

Der nächste Schritt ist Apache/Abfertiger so konfiguriert korrekte Fehlerdokument (Konfiguration in Virtual Host config) zu laden. Auf diese Weise der richtige Belastung der Fehlerseite an dem Apache/Dispatcher delegiert wird -

<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> 

Above Konfiguration basiert auf dem kurzen URLs, wo in dem Muster /content/secondapp/country-x/en/.* verkürzt to /country-4/en/.* und jeder Standort hat seine eigene Seite error.html und nicht-gefunden.html