Giter Club home page Giter Club logo

Comments (3)

casid avatar casid commented on July 18, 2024

Hi @checketts,

thanks for reporting and, ooof, this is wild. I'm not a Spring user, but modifying Spring keys to match jte parameter name syntax is asking for trouble. For instance, once Spring starts having keys with underscores that might collide with the hacked keys.

I'm not sure, but maybe there could be other ways to access those things into the jte templates?

Input from real Spring - jte users would be very welcome here :-)

from jte.

checketts avatar checketts commented on July 18, 2024

The way I've worked around it in my code is to create a ValidationHelper that looks up the validation results. I'll iterate on it a few times, then we could look into adding that in the Spring library and make it configurable.

For JTE, when populating a @param would it be worth supporting handling the periods in model keys? Like mapping those to params with underscores?

For example (in a kte file):

@param org_springframework_validation_BindingResult_myEntry: org.springframework.validation.BeanPropertyBindingResult

Then if there is a key with underscores that would match, it would be used first, and if not, then check for a key with periods?

from jte.

casid avatar casid commented on July 18, 2024

No, I would rather not introduce this kind of magic to jte.

It will add a performance overhead for every template invocation through maps. It also obfuscates constants (e.g. in your example a project wide search will not find org.springframework.validation.BindingResult.myEntry in jte templates).

Adding a utility method to the spring lib sounds like a much better API for this problem.

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.