Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web.xml - What is this and can i remove this?

 
tangara goh
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Experts,

My web hosting company has asked me to remove this web.xml welcome tag file inside; without telling me how to do it.

I have opened up my application to find this.

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

What happen could be I have named my index as index.html instead of .jsp.

Hence, I hope the experts here can advise me can I remove this welcome-file-list altogether ?

Really very lost and looking forward to some kind of assitance......This web hosting company is taking its own sweet time to reply me.....and it's been 2 weeks already and my website still not functioning, even though it can work at my desktop

 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The welcome file list is a list of page names that the server tries out if you go to the address of the web app without specifying a page name explicitly. For example, if you type in http://localhost:8080/myapp/ in the address bar, it will try http://localhost:8080/myapp/index.jsp with the settings in your file. You can specify multiple pages to try:

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

It will then first try index.jsp, if that doesn't exist it will try index.html.

If you remove the whole welcome-file-list, it will try some default settings (probably index.html).

Instead of removing it, you should put the name of the start page of your application in the list.

By the way: Try searching with Google for "web.xml welcome-file-list". Here is a good explanation.
 
tangara goh
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper Young wrote:The welcome file list is a list of page names that the server tries out if you go to the address of the web app without specifying a page name explicitly. For example, if you type in http://localhost:8080/myapp/ in the address bar, it will try http://localhost:8080/myapp/index.jsp with the settings in your file. You can specify multiple pages to try:

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

It will then first try index.jsp, if that doesn't exist it will try index.html.

If you remove the whole welcome-file-list, it will try some default settings (probably index.html).

Instead of removing it, you should put the name of the start page of your application in the list.

By the way: Try searching with Google for "web.xml welcome-file-list". Here is a good explanation.


Thank you Jesper...this is a very clear explanation!

Now, why is it that when I type the url of my website, the file will have www.name.com/webapplication1 appear ? webapplication1 is the name of my project in my netbean IDE. What must I do in order to have just www.name.com appear only?

My web hosting company, even though I have asked them 2 times already, till now havn't give me the answer for that..so I'm hoping the experts here will advise me. Thanks alot.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlet containers can run multiple applications.

In order to have your application show up when the user types http://www.yourdomaind.com, you need to make your application the root or default app.
How you do this depends on the container and how your hosting company has things configured.

Depending on the configuration at the hosting company, it might not be possible to have your root app show up this way.
Most companies have the servlet container running behind the Apache Web Server and give all of their clients the same configuration.

If they're taking to weeks to respond to your questions, maybe you might want to consider a different hosting company.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic