skiabox
skiabox

Reputation: 3507

I can't override Tomcat's default Welcome File List

I am trying to override Tomcat's (version 7) default Welcome File List, as its conf/web.xml suggests by declaring a 'welcome-file-list' tag in the following form

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

in my application's web.xml , but I am getting an error like this :

HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.estore_jsp

Any ideas? Thank you.

Upvotes: 0

Views: 1393

Answers (2)

 prathab
prathab

Reputation: 1

The Tomcat default deployment descriptor file is located in TOMCAT_HOME/conf/web.xml.Over there you would find the default description for tag as:

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

indent <!-- --> the above code and save the /conf/web.xml file. Now place your code

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

in WEB-INF/web.xml of the project and restart the tomcat server you would get the result.

Upvotes: 0

Horizon
Horizon

Reputation: 548

I would try this:

<welcome-file-list>
    <welcome-file>index.html</welcome-file>
</welcome-file-list>
  1. Add the above snippet in your web.xml

  2. Then in index.html, I would use a <link /> tag to forward to my desired landing page, i.e. estore.html in your case.

This should do it.

Upvotes: 2

Related Questions