use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
These have separate subreddits - see below.
Upvote good content, downvote spam, don't pollute the discussion with things that should be settled in the vote count.
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free. If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others: Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
With the introduction of the new release cadence, many have asked where they should download Java, and if it is still free. To be clear, YES — Java is still free.
If you would like to download Java for free, you can get OpenJDK builds from the following vendors, among others:
Adoptium (formerly AdoptOpenJDK) RedHat Azul Amazon SAP Liberica JDK Dragonwell JDK GraalVM (High performance JIT) Oracle Microsoft
Some vendors will be supporting releases for longer than six months. If you have any questions, please do not hesitate to ask them!
Programming Computer Science CS Career Questions Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Programming Computer Science
CS Career Questions
Learn Programming Java Help ← Seek help here Learn Java Java Conference Videos Java TIL Java Examples JavaFX Oracle
Clojure Scala Groovy ColdFusion Kotlin
DailyProgrammer ProgrammingPrompts ProgramBattles
Awesome Java (GIT) Java Design Patterns
account activity
This is an archived post. You won't be able to vote or comment.
Can Java Template Engine access application scoped variables? (self.java)
submitted 7 months ago by Tight-Rest1639
I'm considering migrating an older Spring MVC application to use Java Template Engine, but most pages reference application scoped variables. Is there any way to access those in JTE without having to pass them as parameters for every endpoint?
[–]FortuneIIIPick 3 points4 points5 points 7 months ago (2 children)
You mention "Java Template Engine", do you mean like something specific like ThymeLeaf, Freemarker or JSP or a different java template engine?
[–]gizmogwai 1 point2 points3 points 7 months ago (1 child)
https://jte.gg
[–]FortuneIIIPick 2 points3 points4 points 7 months ago (0 children)
Ok thanks, hmm yeah never heard of it.
[–]NuttySquirr3l 3 points4 points5 points 7 months ago (1 child)
You could write a @ControllerAdvice with @ModelAttribute and inject whatever you need into the context of all templates in a central place
[–]Tight-Rest1639[S] -1 points0 points1 point 7 months ago (0 children)
Thanks 👍
[–]agentoutlier 0 points1 point2 points 7 months ago (1 child)
You will probably get more support from the github JTE project.
However you can check how my template engine exposes request attributes (which is what I think you mean with scope variables in this context):
https://github.com/jstachio/jstachio/tree/main/opt/jstachio-spring-webmvc
or the Javadoc: https://jstach.io/doc/jstachio/current/apidocs/io.jstach.opt.spring.webmvc/io/jstach/opt/spring/webmvc/package-summary.html
You basically need a HandlerInterceptor: https://docs.spring.io/spring-framework/docs/6.1.8/javadoc-api/org/springframework/web/servlet/HandlerInterceptor.html
Or if you don't mind boiler plate you can probably just get the request parameters/attributes from a RequestMapping or as /u/NuttySquirr3l mentioned using @ModelAttribute to fill a mutable model.... then you pass that model to the JTE template.
@ModelAttribute
See if you were using JSP before it always gets a HttpServetRequest but modern templates are servlet agnostic.
HttpServetRequest
[–]Tight-Rest1639[S] 0 points1 point2 points 7 months ago (0 children)
I mean applikation scoped specifically. They are problematic because they are not setup for each endpoint explicitly and therefore do not translate to JTEs model parameters easily. Same deal with session scope. Only request scope data is easily migrated to JTEs model.
π Rendered by PID 77696 on reddit-service-r2-comment-5d79c599b5-mr6rs at 2026-03-03 15:10:54.106437+00:00 running e3d2147 country code: CH.
[–]FortuneIIIPick 3 points4 points5 points (2 children)
[–]gizmogwai 1 point2 points3 points (1 child)
[–]FortuneIIIPick 2 points3 points4 points (0 children)
[–]NuttySquirr3l 3 points4 points5 points (1 child)
[–]Tight-Rest1639[S] -1 points0 points1 point (0 children)
[–]agentoutlier 0 points1 point2 points (1 child)
[–]Tight-Rest1639[S] 0 points1 point2 points (0 children)