turbine-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kxlzx (JIRA)" <j...@apache.org>
Subject [jira] [Created] (TRB-89) template file name can't contain "."
Date Thu, 10 May 2012 09:01:15 GMT
kxlzx created TRB-89:

             Summary: template file name can't contain "."
                 Key: TRB-89
                 URL: https://issues.apache.org/jira/browse/TRB-89
             Project: Turbine
          Issue Type: Bug
          Components: Turbine 2.3
    Affects Versions: Core 2.3.2
            Reporter: kxlzx
             Fix For: Core 2.3.2

I wan't template file name like "user.money.vm". 
but TurbineTemplateService getExtension function use "indexof()" get the file extension. 
It should be "lastindexof()".... 
can you do it? 

    public String getExtension(String template) 
        if (StringUtils.isEmpty(template)) 
            return getDefaultExtension(); 

        //at here ,change to int dotIndex = template.lastindexOf(EXTENSION_SEPARATOR); 
        int dotIndex = template.indexOf(EXTENSION_SEPARATOR); 

        return (dotIndex < 0) ? getDefaultExtension() : template.substring(dotIndex + 1);


This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message