首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

request获取各种途径总结

2012-09-02 
request获取各种路径总结从request获取各种路径总结:request.getRealPath(url)//虚拟目录映射为实际目

request获取各种路径总结

从request获取各种路径总结:

request.getRealPath("url");//虚拟目录映射为实际目录

request.getRealPath("./");//网页所在的目录

request.getRealPath("../");//网页所在目录的上一层目录

?

?

假定你的web application(web应用)名称为news,你的浏览器中输入请求路径:

?

http://localhost:8080/uploading/load.jsp

?

request.getContextPath() ?=> ?/uploading

?

request.getServletPath() ?=> ?/load.jsp

?

request.getRequestURL() ?=> ?http://localhost:8080/uploading/load.jsp

?

request.getRealPath("/") ?=> ??F:\learn\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\uploading\

?

热点排行