SRV.5.5 Path Translation Methods


SRV.5.5 Path Translation Methods

There are two convenience methods in the HttpServletRequest interface which allow the developer to obtain the file system path equivalent to a particular path. These methods are:

  • getRealPath

  • getPathTranslated

The getRealPath method takes a String argument and returns a String representation of a file on the local file system to which that path corresponds. The get PathTranslated method computes the real path of the pathInfo of this request.

In situations where the servlet container cannot determine a valid file path for these methods, such as when the web application is executed from an archive, on a remote file system not accessible locally, or in a database, these methods must return null.



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net