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

Tobias Bocanegra commented on SLING-415:
----------------------------------------

imo all message entries should be cached on startup and updated via 
observation. using the search for each
string output seams to be a lot of overhead.

> 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: Resource
>    Affects Versions: 2.0.0
>         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
>            Priority: Minor
>
> 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)[EMAIL PROTECTED]:language='en_US']/[EMAIL 
> PROTECTED]: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.

Reply via email to