简体   繁体   中英

How to have spring MVC app direct to generic .com url

So for example, if my project name is WebApp and my domain is www.google.com, when running locally I have to type in www.google.com/WebApp. That's not super easy for clients, so I was wondering if there is a way to direct to a home page when typing in www.google.com? Any tips appreciated.

Where are you deploying? To get to www.google.com you have to deploy to the root context or point the root to where you deployed.

Deploying my application at the root in Tomcat

You have a couple of options:

Remove the out-of-the-box ROOT/ directory from tomcat and rename your war file to ROOT.war before deploying it.

Deploy your war as (from your example) war_name.war and configure the context root in conf/server.xml to use your war file :

The first one is easier, but a little more kludgy. The second one is probably the more elegant way to do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM