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")方法。
分享到:
相关推荐
很难找的weblogic支持oracle的blob的驱动包
weblogic下转换oracle 的clob类型经常报转型错误,本例子通过反射解决weblogic.jdbc.wrapper.Clob_oracle_sql_CLOB转型成oracle.sql.CLOB问题
WebLogic 12c(12.2.1.2)升级方案:从weblogic 8.1升级到最新版本 12.2.1.3
sxt\weblogic\weblogic安装.avi sxt\weblogic\weblogic安装.avisxt\weblogic\weblogic安装.avi sxt\weblogic\weblogic安装.avi
hungryminds.bea.weblogic.server.bible.pdf WebLogic宝典
windows系统 weblogic 12.2.1.3.0.打补丁操作流程,包含最新补丁和13.9.4.2.4Optach所需的jar包,opatch_generic.jar
linux环境weblogic集群简单配置.pdflinux环境weblogic集群简单配置.pdflinux环境weblogic集群简单配置.pdflinux环境weblogic集群简单配置.pdflinux环境weblogic集群简单配置.pdflinux环境weblogic集群简单配置.pdf...
weblogic相关jar包合集,包含weblogic.jar、wlclient.jar、wls-api.jar、api.jar,需要用到的可以下载
weblogic91的api.jar 版本:weblogic的91 jar包:api.jar
weblogic for linux安装.doc
weblogic 配置帮助文档.xls weblogic 配置帮助文档.xls
weblogic.jdbc.vendor.oracle.OracleResultSet 解决weblogic数据库连接池存储大字段所需包
先下载weblogic_monitor.rar,并解压至一个目录 java -jar weblogic_monitor.jar 如: E:\Java\jdk1.6.0_25\bin\java -jar weblogic_monitor.jar 注意: 1. 必须使用1.6或者以上jdk 2. 本机不用安装weblogic 3. 可以...
weblogic系统加固规范.pdf weblogic系统加固规范.pdf
2021 年 1 月 20 日,Oracle 发布了大量安全补丁,涉及旗下产品(Database Server、Weblogic Server、Java SE、MySQL等)多个漏洞。
tomcat和weblogic共2页.pdf.zip
1.进入AdmainServer启动startWeblogic.cmd 2.进入bin目录编写bat执行脚本 ,新建startNodes_1.bat 和startProxy_server.bat 文件 startNodes_1.bat 内容: startManagedWebLogic.cmd nodes_1 startProxy_server.bat ...
weblogic_wls1031.exe
JBuilder X+WebLogic 8.1.x.doc开发
Weblogic 应用服务器的安装和配置 .Exercise: Weblogic 应用服务器安装及配置 管理控制台的使用(参数、监控、日志等) .Exercise: Explore the Weblogic Application Server through the Administrative Console ...