You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2010/10/15 14:56:34 UTC

[jira] Closed: (SLING-415) Internationalization: if sling:key contains invalid characters, query for resources fails

     [ https://issues.apache.org/jira/browse/SLING-415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-415.
----------------------------------


> Internationalization: if sling:key contains invalid characters, query for resources fails
> -----------------------------------------------------------------------------------------
>
>                 Key: SLING-415
>                 URL: https://issues.apache.org/jira/browse/SLING-415
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: I18n 2.0.2
>         Environment: Darwin 9.2.2 Darwin Kernel Version 9.2.2: Tue Mar  4 21:17:34 PST 2008; root:xnu-1228.4.31~1/RELEASE_I386 i386,
> java version "1.5.0_13"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
> Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)
>            Reporter: Dominique Jäggi
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: I18n 2.0.2
>
>
> If a sling:Message with e.g. sling:key = "List of a rootpage's childpages" is defined, the org.apache.sling.jcr.resource.internal.JcrResourceResolver.queryResources(JcrResourceResolver.java:234) class will fail with a lexical query error due to the apostrophe in this case:
> resulting query:
> //element(*,mix:language)[@jcr:language='en_US']/*[@sling:key='Liste of a rootpage's childpages']/@sling:message
> resulting exception:
> rror while generating JSON componet list org.apache.sling.api.resource.QuerySyntaxException: Lexical error at line 1, column 133.  Encountered: <EOF> after : "\']/@sling:message return $v": Lexical error at line 1, column 133.  Encountered: <EOF> after : "\']/@sling:message return $v"
> 	at org.apache.sling.jcr.resource.internal.JcrResourceResolver.queryResources(JcrResourceResolver.java:234)
> 	at org.apache.sling.i18n.impl.JcrResourceBundle.loadResource(JcrResourceBundle.java:147)
> 	at org.apache.sling.i18n.impl.JcrResourceBundle.handleGetObject(JcrResourceBundle.java:96)
> 	at java.util.ResourceBundle.getObject(ResourceBundle.java:319)
> 	at java.util.ResourceBundle.getString(ResourceBundle.java:285)
> (...)
> should the natural language approach be the way to go, probably special characters should be allowed (escaped internally).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.