[ 
https://issues.apache.org/jira/browse/SLING-5051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14985088#comment-14985088
 ] 

Julian Sedding commented on SLING-5051:
---------------------------------------

This is likely a symptom of SLING-5071, i.e. a problem with filter ordering. 
Your filter has {{service.ranking=0}} while the I18nFilter before SLING-5071 
has {{service.ranking=-700}}. Provided the unfortunate change in SLING-2920 
reversed the filter ordering (now in descending order), {{0}} now comes before 
{{-700}} and thus I18N is not yet initialized in your filter.

You can update the I18N Bundle to  version 2.4.6 to restore a proper ordering 
(note in AEM 6.1 the {{service.ranking}} of the I18nFilter is configured to 
-10000 in {{/libs/sling/config}}), so take that into account. Please close this 
issue as duplicate of SLING-5071 if this solves your problem.

> RequestDispatcher forward breaks i18n
> -------------------------------------
>
>                 Key: SLING-5051
>                 URL: https://issues.apache.org/jira/browse/SLING-5051
>             Project: Sling
>          Issue Type: Bug
>          Components: General
>         Environment: Adobe Experience Manager 6.1
>            Reporter: Sothea Nim
>
> I just noticed that on AEM 6, in my Filter, when I call RequestDispatcher 
> forward, i.e. request.getRequestDispatcher(...).forward(req, res);, it cause 
> i18n to break. Here's a snippet of my codes:
> ...
> boolean filtered = false;
> SlingHttpServletRequest request = req instanceof SlingHttpServletRequest ? 
> (SlingHttpServletRequest) req : null;
> SlingHttpServletResponse response = res instanceof SlingHttpServletResponse ? 
> (SlingHttpServletResponse) res : null;
>             
> if (request != null && response != null) {
>                 
>     // block of codes to resolve the request uri and get the new desired URI 
>                     
>     if (this.resolvedUriResource != null) {
>         String uri = this.resolvedUriResource.getPath() + ".html";
>         RequestDispatcherOptions options = new RequestDispatcherOptions();
>         options.setAddSelectors(uriSelectors);
>         
> this.filterConfig.getServletContext().getRequestDispatcher(uri).forward(req, 
> res); // OR
>         //request.getRequestDispatcher(this.resolvedUriResource, 
> options).forward(req, res);
>         filtered = true;
>     }
> }
> if (!filtered) {
>     chain.doFilter(req, res);
> }
> ...
> Obtain the package contained detailed codes here: 
> http://www.sotheanim.com/images/www.sotheanim.com/blog/aem61-i18n-issue-samplepackage.zip
>  
> (/sixd/bundle/src/main/java/com/sixd/i18nissue/filter/PathResolutionFilter.java)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to