Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

welcome-file leading traling slash question

 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Servlet2.4 specification says that the welcome files specified in the DD (see below) should not have any leading or trailing slashes. HFS jokingly says (page 590) "bad things will happen" if we violate the rule.Yet putting a leading slash works fine with tomcat 5.x and the page shows up fine.

My question is: what is the "bad thing" that can happen? Does it mean that the web-app would not be portable?

Thanks,
 
Indunil Dasanayaka
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
since in the spec it has been defined as there should not be a / vendor can implement the container to either handle the / or not. If it has not been handled there should be an exception.
 
MI Mohammed
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Debashish,
I like your approach of daring the spec. But, for the exam, just follow the spec because the whole aim of the spec is to free your codes from been vendour
specific. If one follow the spec, your codes are guarranty to run on any web
container.
May be try moving the same code to another container, it might just blow up. For the exam, the spec is the master. Hope it's help.

SCJA SCJP SCWCD SCBCD prog...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic