• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding relative path

 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic