Comments (3)
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.
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.
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)
- HTML Comments Inside Content Blocks Cause Compilation Failure in gg.jte.gradle v3.1.7+ HOT 2
- Allow expressions in HTML attribute names for certain types HOT 9
- Spring Boot integration and binary rendering HOT 6
- ${"\\"} Causes "Unexpected end of template expression" HOT 1
- Pass dynamic HTML Content to template HOT 2
- Support JTE project HOT 2
- Failed to compile with module-info.java HOT 2
- Support for read-only filesystem HOT 1
- template define with generic type HOT 1
- Generic template HOT 3
- Html Template Output HOT 2
- Add kotlin and kte documentation HOT 1
- String input instead of file input HOT 6
- Provide jte-jsp-converter for Jakarta HOT 1
- Comments break JTE HOT 5
- intellij "Cannot resolve MVC view" HOT 4
- KTE runtime dependencies HOT 8
- Suppress warnings in generated java source files HOT 1
- PluginException: ActionUpdateThread.OLD_EDT is deprecated and going to be removed soon.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jte.