role of different components in the lucee stack

59 views
Skip to first unread message

Brian FitzGerald

unread,
Apr 1, 2016, 4:32:47 PM4/1/16
to Lucee
I realize this probably sounds like a ridiculous question, but I'm going to ask it anyway. For the layman (aka cfml/lucee-script developer), leaving buzzwords aside, why is the "servlet container" necessary in the world of lucee (and other languages built on top of Java)?

If the JVM process java bytecode, and Lucee compiles lucee script into java bytecode, then why do we need Tomcat? I realize that it "implements several Java EE specifications," but that doesn't help my understanding (as a layman). Could Tomcat (and the specifications it implements) be considered an "extension" of the Java, much like the Lucee 5 "core" will only implement a subset of language features, with additional features (i.e. image processing, or pdf processing, or whatever) only available as "extensions" to that core?

In plain English, what exactly does Tomcat provide that Java itself doesn't already offer, and why doesn't Java implement those specifications on its own?? Help me wrap my melon around this please. Google seems to offer very little beginner friendly content to "introduction to tomcat." Thank you Java/Tomcat/Lucee enlightened warriors.

Jon Clausen

unread,
Apr 1, 2016, 5:22:27 PM4/1/16
to lu...@googlegroups.com
Brian,

In layman terms (and I’m sure some could consider this an over-simplification, as there are **much** more complex explanations to be had), the Lucee servlet is the “app" that runs within the servlet container, which is the “app" that runs within the “app" that is the JRE.

Your CFML code is the smallest “doll” in the Java Russian nesting doll, if you will.  Each “doll” introduces shared language, classes and conventions along the way that the nested applications/servlets can take advantage of.  You wouldn’t want those all in the language, itself, because their purposes, classes and conventions are not universal to all of the potential use-cases of the language.

This is not uncommon in any programming languages.  Though they are not called such and differ in their implementation, NodeJS effectively functions as a “JRE" for Javascript, with each dependency in the chain (e.g. ExpressJS) becoming a “container” of sorts that introduces new language and conventions. Rails the same for Ruby - along with its framework ( aka - the Rails "container” ).  PHP for the web requires a “container” in the form of FastCGI or some other middleware that can speak to a web server. Building apps with Go, Python, or any other language often requires (or is made easier by) the inclusion of “containers” along the way.

In short, Lucee introduces, via the JRE first and then the servlet container, the shared conventions through which a translation from CFML to the top-level language is possible.  Without the nested “doll” the final step of translation is impossible.

HTH,

Jon
--
Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/66032e04-2be9-4064-aaf8-fb59b2e49852%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jon Clausen

unread,
Apr 1, 2016, 5:29:23 PM4/1/16
to lu...@googlegroups.com
On a related note, the servlet container doesn’t need to be as fully-featured as Tomcat.  It just needs to have enough of the shared classes and conventions in the chain to let Lucee do its thing.  For an example of how CFML can be used as a server-side scripting language, you need only look at CommandBox: https://www.ortussolutions.com/products/commandbox

Brian FitzGerald

unread,
Apr 2, 2016, 2:15:28 PM4/2/16
to Lucee
Thank you for your detailed response Jon! I really appreciate you sharing that analogy with me. Took me a couple reads, but it makes sense and gives me a better baseline from which I can dig in further.

Just moved my Lucee application to Elastic Beanstalk and was needing to troubleshoot why Tomcat was crashing, which as you might guess can prove rather difficult when you know next to nothing about Tomcat!
Reply all
Reply to author
Forward
0 new messages