A
A
Andrey Shishkin2015-12-15 18:49:14
Java
Andrey Shishkin, 2015-12-15 18:49:14

Why is context root needed in glassfish?

Created a servlet, deploy it in glassfish4. In the mappings in web.xml for the servlet, I specified the url-pattern to work on /mysrv. But it works on a url like /<context root>/mysrv.
Why is this context root needed if I can set up mappings in web.xml? Moreover, if nothing is specified in the context root, then the servlet does not work, and if removed after deployment, it works on the old value.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Shishkin, 2015-12-23
@compiler

In general, again, he got to the bottom of the truth)
Context root is a kind of prefix for servlets. If it is not needed, then during deployment or after deployment, it can be removed in the settings. But then you will need to specify this servlet as the default web module in the
Configurations -> Virtual Servers -> server -> Default Web Module console.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question