jsp获取Java的值,如何在jsp中获取JAVA_OPTS值

"本文指导如何在JSP文件中通过System.getProperty()获取catalina.bat中定义的JAVA_OPTS系统属性,如-DMyProjectHome,以实现动态变量${MyProjectHome}
摘要由CSDN通过智能技术生成

I am trying to get JAVA_OPTS value defined in catalina.bat in a jsp file. Can someone tell me how to do that.

For Example: My JAVA_OPTS definition in catalina.bat is like

JAVA_OPS= -DMyProjectHome=D:\Projects

I want to have the value of MyProjectHome at run time in jsp file so I am trying to do is ${MyProjectHome} but it is doing nothing.

Or is there a way I can define JAVA_OPTS value in

Please help me out achieving my functionality.

thanks.

解决方案

what you pass to a JVM with -Dfoo=bar is called a system property. You can get their value using System.getProperty(). There is no standard tag or JSP EL syntax to get them, though, so you'll have to use scriptlet or implement a custom tag.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值