Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding relative path

 
Gaurav Chikara
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
can anyone tell why tomcat looks for index.html file first
in whatever directory we open
suppose the working directory of tomcat is like this
http://localhost:8080/examples/servlets/
and if i type this url into browser it opens the index.html
Now suppose if i want to open some other file say index.jsp instead of index.html
or say
index2.html instead of index.html
then where i have to make change in entry of deployment descriptor
then how can i do it
can anyone pls suggest
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Mr. Gaurav,
I dont know but you have definitely asked something that is completely different from the subject matter. Its a sign of ........... !!
Anyways, the answer is that you can make an entry in the DD like this giving the name of the default which you want to open. :
<welcome-file-list>index.html</welcome-file-list>
All the best.
 
Marlon Bravo
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gaurav,
Using the <welcome-file-list> is the right approach if you want Tomcat to look for a file other than default index.html file. The <welcome-file-list> allows you to specify more than just one default file using at least one or more <welcome-file> tags. For example, using the following entries, Tomcat will look for index.jsp first and if it can't find that, it'll look for welcome.jsp.
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>
Be sure to place the <welcome-file> tags within the <welcome-file-list> to list your entries. Consult sun's dtd at http://java.sun.com/dtd/web-app_2_3.dtd if you're not sure where to place the tags within the DD.
-Marlon
[ April 21, 2002: Message edited by: Marlon Bravo ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic