tomcat7 - How to set the context path of a web application in Tomcat 7.0 -


I know that I can change the name of my webpad (or its wise file) root But this is a terrible way to do this, IMHO I now use the Tomcat Dock & amp; It says that

elements directly to the server It is not advisable to put it in XML file

So I have suggested it another way that he has suggested.

So I have a /META-INF/context.xml with the following code,

     

But when I failed to load the reference on "/" even after deploying the server after restarting, it still has "/" & lt; WEB_APP_NAME & gt; ; "

What you can do the following;

In the ROOT.xml & lt; Catalina_home & gt; Add a file named / conf / Catalina / localhost /

This ROOT.xml will override the default settings for that engine and host (Catalina and localhost) for the original reference of the typic installation.

Enter the following in the ROOT.xml file;

  & lt; Contact dockbase = "& lt; yourApp & gt;" Path = "" reloadable = "true" />   

here, & lt; YourApp & gt; is the name of, okay, your app .. :)

And you can go there, your app is now the default application and it is http: // localhost: 8080 < / Code>

, however, there is a side effect; Your application will be loaded twice. Once, once for localhost: 8080 and localhost: 8080 / yourApp . To fix this, you can send your application to the outside & lt; Catalina_home & gt; / Webapp and can use a relative or full path in the Dobbas tag of ROOT.xml. something like that;

  & lt; Reference docbase = "/ opt / mywebapps /" yourapp & gt; " Path = "" reloadable = "true" />   

and then it should be all right!

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -