Giter Club home page Giter Club logo

Comments (9)

casid avatar casid commented on July 18, 2024 1

@dector release 1.5.0 is out and available on maven central. It contains this feature :-)

from jte.

dector avatar dector commented on July 18, 2024 1

@casid Thank you, will update! :)

from jte.

casid avatar casid commented on July 18, 2024

Looks like Ktor uses a different classloader than the application class loader.

I think it could work if we allow to configure the parent class loader jte uses in gg.jte.internal.TemplateLoader.

    protected ClassLoader createClassLoader() {
        try {
            return new URLClassLoader(new URL[]{classDirectory.toUri().toURL()});
        } catch (MalformedURLException e) {
            throw new TemplateException("Failed to create class loader for " + classDirectory, e);
        }
    }

from jte.

casid avatar casid commented on July 18, 2024

@dector I added a factory method to create a template engine with a parent class loader.

Would you like to give it a try if this helps to get it running with Ktor?

You'd need to clone this repository, run mvn install on jte-parent and use version 1.5.0-SNAPSHOT as dependency.

from jte.

dector avatar dector commented on July 18, 2024

Awesome, thanks! I will try providing class loader today and tell you what are the results.
Really appreciated for the help!

from jte.

dector avatar dector commented on July 18, 2024

@casid I can confirm that providing child (not app) classloader to TemplateEngine factory method works fine.

You can close this issue for now - I'll create new one with PR when I'll be able to bundle this functionality as a Ktor Feature.

from jte.

kelunik avatar kelunik commented on July 18, 2024

@dector Cool, thanks for reporting back! 😄

from jte.

dector avatar dector commented on July 18, 2024

JIC: Using Jitpack version for now.

from jte.

casid avatar casid commented on July 18, 2024

@dector that's pretty cool! Thanks for testing and reporting back so quickly.

from jte.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.