• Post Reply Bookmark Topic Watch Topic
  • New Topic

URL... but not specific  RSS feed

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How this kind of URL can open any page, even if we are not specifying any welcome page in web.xml:

http://localhost:8080/a/b



Thanks.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The container may have some default welcome-page defined.
In Tomcat 5.5:
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have one doubt by seeing this thread

why we need to specify more than one welcome file in welcome-file-list tag??

if reason for that is, suppose first welcome file is not available then second one is called.

how the deployer deploy the application without knowing whether file is exists or not??

Suppose if 3 files are specfied in welcome-file-list and all 3 are not available what will happen??
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vidya sagar:

Suppose if 3 files are specfied in welcome-file-list and all 3 are not available what will happen??


404 - page not found exception.

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why we need to specify more than one welcome file in welcome-file-list tag??

This is not a "need". Tomcat just defines them this way because lots of web sites use(d) their top page with such a name.

Suppose if 3 files are specfied in welcome-file-list and all 3 are not available what will happen??

As rathi said, page not found. You'll just have to define your own welcome-page, and set it in your own web.xml
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by rathi ji:


404 - page not found exception.



not really.

if you goto http://localhost/yourApp, and if your welcome files dont exist, then tomcat will give you the directory listing of yourApp. (Although this may differ depending on what servlet engine you are using)
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Directory listing is seen on browser for Tomcat.(Just now tested)
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that directory listing is seen if you have permission to see it. Not sure.
 
Richard Green
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nope. directory listing is visible for everyone (unless you put a welcome file)
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://localhost:8080/a/b

a - application root (context)

What does this 'b' mean???

If 'b' is one of the folder inside 'a' then also will tomcat be able to display welcome page???

Thanks.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!