venusdrogon / feilong-platform

:gem:all feilong projects's parent
http://feitianbenyue.iteye.com/
Apache License 2.0
94 stars 58 forks source link

重构 feilong Velocity #100

Closed venusdrogon closed 7 years ago

venusdrogon commented 7 years ago

重构 feilong Velocity

新增

    public String parseString(String templateName,String vmContent,Map<String, ?> contextKeyValues){
        // Initialize my template repository. 
        StringResourceRepository stringResourceRepository = (StringResourceRepository) STRING_VELOCITY_ENGINE
                        .getApplicationAttribute(StringResourceLoader.REPOSITORY_NAME_DEFAULT);

        stringResourceRepository.putStringResource(templateName, vmContent);

        //---------------------------------------------------------------

        // Set parameters for my template.
        Context context = buildContext(contextKeyValues);

        // Show the result.
        return buildStringValue(STRING_VELOCITY_ENGINE, templateName, context);
    }