简体   繁体   中英

Why I still get “http://localhost:8080” when I start my app by tomcat?

I already set my as below:

<welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
</welcome-file-list>

When I click run in Netbeans everything is good but first page is still

http://localhost:8080

What else can I do ? Do i need to configure another files in java code or tomcat?

Welcome pages make sense in a context. If you have multiple WARs there would be multiple contexts each with a separate set of welcome-pages. Try deploying your app as a ROOT.war and test it to see if it is the case

See the following posts for more information.

Inside $TOMCAT_HOME/conf/web.xml there is a section called and it looks like this:

<welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

The default servlet attempts to load the index.* files in the order listed. You may easily override the index.jsp file by creating an index.html file at $TOMCAT_HOME/webapps/ROOT. It's somewhat common for that file to contain a new static home page or a redirect to a servlet's main page. A redirect would look like:

<html>

<head>
<meta http-equiv="refresh" content="0;URL=http://webaddress.com/some/path/to/servlet/homepage/">
</head>

<body>
</body>

</html>

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