ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf Assmann (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATIS-340) Loading Resources With Different Charsets
Date Mon, 04 Sep 2006 07:27:22 GMT
    [ http://issues.apache.org/jira/browse/IBATIS-340?page=comments#action_12432440 ] 
Ralf Assmann commented on IBATIS-340:

For loading resources, ibatis will use the class com.ibatis.common.resources.Resources. Using
this class, there will be a problem loading resources on a different environment than the
code has been deployed on. E.g., if the code is deployed on an Windows computer, but it runs
on an AIX, there is a problem loading the resources.

The problem exists because of different charset on different environments. For loading the
first xml-file sqlMapConfix.xml (which will be given to SqlMapClientBuilder.buildSqlMapClient(...)),
this problem can be solved by using a different loader. But after that, ibatis will load more
xml-files, the ones which are defined in the first one, using tags <sqlMap resource=...>.
Here, ibatis uses getResourceAsReader(...) from the Resources-class - and then it will not

A solution could be telling the Resources-class, which charset should be used. In the attached
file to this issue, this has been done by adding a property-attribute. A CHARSET can be added
to this property-list, using the method addProperty(...). If calling getResourceAsReader(...)
from the Resource-class, if is looked up if a property CHARSET exists. If yes, this will be
used creating the new InputStreamReader ...

> Loading Resources With Different Charsets
> -----------------------------------------
>                 Key: IBATIS-340
>                 URL: http://issues.apache.org/jira/browse/IBATIS-340
>             Project: iBatis for Java
>          Issue Type: Bug
>            Reporter: Ralf Assmann
>         Attachments: Resources.java

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message