-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Mladen,

On 11/25/19 10:28, Mladen Adamović wrote:
> I wonder why somebody would want to run "embedded Tomcat" and what
> it actually means?

It means that the application starts the servlet container, not the
other way around.

> I'm working professionally in software engineering since 2003 and
> I'm puzzled.
> 
> From looking into that article, it seems that Java app starts
> Tomcat, why somebody would want that?

I think if you don't understand why anyone would want to do that, then
it would be hard to understand :)

Perhaps the focus of the application is not servlet-related, but there
is a portion where it makes sense to have a servlet container running.
The application uses Tomcat as an embedded servlet container in that cas
e.

Also, many containerized environments favor a single application
entry-point. Instead of installing the servlet container (really the
application, here), then some other associated bits (which happens to
be your application) and then launching the application (Tomcat), you
install a single application and execute it. The application uses
Tomcat as an embedded servlet container basically to bootstrap itself.

Finally, in either of the above scenarios, it's possible that you want
to fetch your servlet container configuration from some kind of
centralized place (e.g. Kubernetes in the case of clustered
containerization, perhaps some other mechanism in other cases). Tomcat
itself isn't really good at loading its configuration from arbitrary
places, even though it's possible to e.g. load remotely, etc. Instead,
the application starts, locates its configuration, then launches
Tomcat with that configuration. It's easier for the application to
understand the nuances of that environment, locating its
configuration, etc. than it would be to add layers of plug-ins, etc.
to Tomcat to accomplish the same thing.

Hope that helps,
- -chris

> On Sun, Nov 24, 2019 at 12:27 AM Behrang Saeedzadeh
> <behran...@gmail.com> wrote:
> 
>> I will create a PR if I find the time to write one.
>> 
>> On Sat, Nov 23, 2019 at 9:40 PM Mark Thomas <ma...@apache.org>
>> wrote:
>> 
>>> On 23/11/2019 08:17, Behrang Saeedzadeh wrote:
>>>> Hi all,
>>>> 
>>>> Are there any official docs for how to run Tomcat as an
>>>> embedded
>> server?
>>>> Searching returns some results such as
>>>> 
>>> 
>> https://devcenter.heroku.com/articles/create-a-java-web-application-u
sing-embedded-tomcat
>>>>
>> 
but I haven't seen any official docs.
>>>> 
>>>> Are there any?
>>> 
>>> 
>> http://tomcat.apache.org/tomcat-9.0-doc/api/org/apache/catalina/start
up/Tomcat.html
>>>
>>>
>> 
is the closest thing we have but I suspect parts of it are out of date.
>>> The unit tests are a good source of samples of how to use it.
>>> 
>>> Care to contribute a how-to page for the docs?
>>> 
>>> Mark
>>> 
>>> --------------------------------------------------------------------
- -
>>>
>>> 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>> 
>>> 
>> 
> 
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl3b/fQACgkQHPApP6U8
pFhVDA//R2/SivLy/r69lwzgCo3DL3H3Q3PW7TK4hcaGfiTxH7YX4VyVKxHD3YWl
hnncdwbQDJM1nsDpq6hLIs0kZ6yz+B/b6yDBgqkeu7mDo/gqpTRZHgpGEBst3t97
5t+Fxl5txHL4Fx3eO/R6IGu9JnDHr/9cpXVNq/t10b8D/Vf3k6IXx/aBBuPhdxRX
iVLJFmO3uVe/w19PKMCgdLlfF1zRQwDkzASEviOepn+AY9tpZidy0MjMkZmPsSIs
dszlLSlUWjuLYWre2tIg2DF2GAwX02JDCVlgk68U120XMjWVlR8usnSdaeg8fTKd
4s2VO64z3s9umSIXFnexP3Nv4BX4Nm2wn4j3vOZSz3W/jTu8kJlr3rUt6gSSBHc4
4guhg5uWeS67bpOovgIxVHDL3CX83oC2WIhd7U/iTH8Xcf23hI/6EWNc9BalvAs7
j27WTFOlVFx45TeUoHJ82KjEulvvRb/zyeopytrymXAPBBzaVGslmgOCn5lZoG0k
DH3kmPyVeVYdP2frcTNyTVvcQuGZ4fiNFoYwcDE7RXi9t+98T+AI5poREiZXryZ4
OzEptdybzb3yJ2di2MipvdYZ9erxAwMLpMIAAboPQ+YE3wzmMlu3iAReTvjNnc11
0FwRycrjtQy/ZbmDzr6hBldUoOttkTyeN/VbSFGAQqBcNBW5X9A=
=tcwE
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to