vmstat - Linux系统性能监控工具
2014-07-04 13:54
447 查看
weblogic获取路径总是为NULL
通常情况下载tomcat中
我们以前使用 HttpServletRequest request; request.getRealPath(arg0);
但是这是个过时的方法
request.getSession().getServletContext().getRealPath() 得到站点的绝对地址
HttpServletRequest request;
request.getSession().getServletContext().getRealPath(arg0);
在strut中通过
this.getServlet().getServletContext().getRealPath(arg0);
ServletActionContext.getServletContext().getRealPath(agr0)
在Servlet中通过 extends HttpServlet
this.getServletContext().getRealPath(arg0);
如果 weblogic里面war项目获取路径为空
对一个打包的应用来说,是没有RealPath的概念的,调用getRealPath只会简单地返回null
那么可以推荐尝试
String path=this.getClass().getClassLoader().getResource("/").getPath();
上面这个是获取了web-inf/classes里面的路径,
也可以使用ServletContext.getResourceAsStream("/WEB-INF/config/db.config")方法。
通常情况下载tomcat中
我们以前使用 HttpServletRequest request; request.getRealPath(arg0);
但是这是个过时的方法
request.getSession().getServletContext().getRealPath() 得到站点的绝对地址
HttpServletRequest request;
request.getSession().getServletContext().getRealPath(arg0);
在strut中通过
this.getServlet().getServletContext().getRealPath(arg0);
ServletActionContext.getServletContext().getRealPath(agr0)
在Servlet中通过 extends HttpServlet
this.getServletContext().getRealPath(arg0);
如果 weblogic里面war项目获取路径为空
对一个打包的应用来说,是没有RealPath的概念的,调用getRealPath只会简单地返回null
那么可以推荐尝试
String path=this.getClass().getClassLoader().getResource("/").getPath();
上面这个是获取了web-inf/classes里面的路径,
也可以使用ServletContext.getResourceAsStream("/WEB-INF/config/db.config")方法。
相关文章推荐
- Linux下面监控系统性能的工具-vmstat
- Linux系统监控工具之vmstat详解
- Linux中系统整体性能监控工具详细介绍
- 全能冠军:Linux系统性能和使用活动监控工具 sysstat
- Linux系统整体性能监控工具详解
- 全能冠军:Linux系统性能和使用活动监控工具 sysstat
- Linux系统监控工具之vmstat详解
- Linux中系统整体性能监控工具详细介绍
- linux --监控系统性能 vmstat
- Linux系统监控工具之vmstat详解
- Linux系统监控工具之vmstat详解
- Linux系统性能监控工具
- linux系统性能监控命令vmstat(四)
- 几个linux系统性能监控命令vmstat iostat top
- Linux中系统整体性能监控工具详细介绍
- Linux系统整体性能监控工具详解
- linux常用系统性能监控工具
- 《高性能Linux服务器构建实战运维监控、性能调优与集群应用》 10.6 Linux下常见的性能分析工具 vmstat
- Linux系统性能监控工具
- unix、linux下的系统性能监控工具nmon