getRealPath方法为何返回的是null

在WebLogic 11的weblogic.xml中可以自定义show-archived-real-path-enabled参数的值,用于使request.getSession().getServletContext().getRealPath("")方法在返回实际路径。
<container-descriptor>
        <show-archived-real-path-enabled>true</show-archived-real-path-enabled>
    </container-descriptor>


此参数对于打包的(归档的)web应用程序生效,当设置为true时,getRealPath()返回资源对应的实际路径。否则返回null。

猜你喜欢

转载自ultrang.iteye.com/blog/2246643