Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Temporary Working Directories.

 
Krishna, Alle
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I was reading the Servlet 2.3 spec for the SCWCD. The spec says that Servlet Containers must provide a private temporary directory per servlet context and make it available via a javax.servlet.context.tempdir
context attribute. Is this package somewhere present in individual or respective implementations of Servlet/Web Containers? This definitely is not part of the Servlet Extension API.
Can someone clarify this for me?
Thanks in advance.
Vasanth
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When creating reusable code such as tag libraries or Servlet specifications, it is a good habit to prefix attribute names with your code's package name so as to prevent clashes with other libraries.
This is why the attribute name starts with "javax.servlet". Had they simply named it "context.tempdir" or "tempdir", it is quite likely that someone, somewhere, would use or have used an attribute with the very same name and the results could be unpleasant.
But do keep in mind that this is an attribute name and not a Java package. It does not mean there is a javax.servlet.context package somewhere.
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic