This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes ServletContext getResource(String path) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "ServletContext getResource(String path)" Watch "ServletContext getResource(String path)" New topic
Author

ServletContext getResource(String path)

Zhiyong Sun
Greenhorn

Joined: Nov 24, 2002
Posts: 4
The path MUST begin with a "/" and is interpreted as relative to the current context root. This is defined in the Servlet API.
However, I tested this funciton without "/" and it still works fine. Also, in the example code from that Minning Published SCWCD Study Kit, it also did not use "/".
Can anybody clarify this?
Brusk Baran
Ranch Hand

Joined: Nov 15, 2001
Posts: 132
Did you reload the class then after having changed and re-compiled?
Peter den Haan
author
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
It is well possible that some servlet engines are more lenient than the specification. Does it matter?
- Peter
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ServletContext getResource(String path)